View Full Version : Running an application on exit
artistscope
09-26-2004, 10:11 PM
Am trying to start an executable jar file on exit and not succeeding. Have tried the following but still no result...
-- These actions are performed when the Cancel button is clicked.
File.Open(SessionVar.Expand("%AppFolder%\\SecureImagePro.jar"), "", SW_SHOWNORMAL);
-- These actions are performed when the Cancel button is clicked.
result = File.Run(SessionVar.Expand("%AppFolder%\\SecureImagePro.jar"), "", "", SW_SHOWNORMAL, false);
JXBURNS
09-27-2004, 06:48 AM
The second looks OK to me.
I assume you have actually tried running the file manually from whatever the %AppFolder% is expanded to your SUF7 session variables?
Have you verified that %AppFolder% does actually expand to what you expect?
result = Dialog.Message("Expanded Folder Name", SessionVar.Expand("%AppFolder%"), MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
John
artistscope
09-27-2004, 08:08 AM
The jar file runs ok manually.
Have created a setup log file and the routine doesn't appear, not even mention of a failure.
JXBURNS
09-27-2004, 08:36 AM
How about following Brett's thread re checking this out in debug mode?
http://www.indigorose.com/forums/showthread.php?p=39664#post39664
Rgds John
artistscope
09-27-2004, 09:59 AM
Changed it to run on shutdown from the Actions menu instead... the following started ok...
result = File.Run(SessionVar.Expand("%AppFolder%\\test.exe"), "", "", SW_SHOWNORMAL, false);
But it wouldn't work opening the jar file which is executable and runs on all manual commands.
Thanks for the Debug routine. Unfortunately I missed the related debug message as it closes when the installer exits.
JXBURNS
09-27-2004, 10:02 AM
I think the key may well be what it states in the Help file for FILE.RUN:
"The path to the executable (.exe) file."
Note the specific use of the ".EXE"..
Something for IR to answer me thinks.. Can't test myself at the moment as in middle of editing 2500+ registry commands..
John
artistscope
09-27-2004, 10:38 AM
This works on shutdown...
File.Open(SessionVar.Expand("%AppFolder%\\SecureImagePro.jar"), "", SW_SHOWNORMAL);
JXBURNS
09-27-2004, 11:46 AM
Assuming you are running a NT-based OS you probably need to make sure the environment variable includes .JAR e.g.
set PATHEXT=.EXE;.BAT;.CMD;.JAR
This I believe forces Windows to run the JAVA command to then run the .JAR file.
John
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.