PDA

View Full Version : Skipping Actions.On Shutdown???


csd214
02-23-2005, 10:09 AM
During development my project has started to be nasty. The Setup Log ends like this:

Success Run project event: On Post Install
Success Display screen: Finished Install
Success Delete image file: C:\DOCUME~1\user\LOCALS~1\Temp\_ir_sf7_temp_0\IRIM G1.JPG
Success Delete image file: C:\DOCUME~1\iser\LOCALS~1\Temp\_ir_sf7_temp_0\IRIM G2.JPG
Success Delete image file: C:\DOCUME~1\user\LOCALS~1\Temp\_ir_sf7_temp_0\IRIM G3.JPG
Success Delete primer file: C:\DOCUME~1\user\LOCALS~1\Temp\_ir_sf7_temp_0\Firm aLogo.jpg
Success Delete plugin file: C:\DOCUME~1\user\LOCALS~1\Temp\_ir_sf7_temp_0\LuaC OM.lmd
Error Setup did not complete successfully (5)

Missing: Success Run project event: On Shutdown

At last I discovered what can be seen from the log: The On Shutdown actions are skipped! That does not mean anything for the install (everything is OK), but it destroys my uninstall procedure. In On Shutdown I have these commands:

tItem_Data = UninstallData.GetItem(UNINDATA_MAIN, "EXELocation");
cUninstallFile = tItem_Data.Value
SessionVar.Set("%UninstallFile%", cUninstallFile);

I need the session variable during the uninstall process.

There is no other error messages in the setup log (write mode: Extended errors). I have tried to remove the actions added today. So far to no help. The behaviour is project dependent.

Weird! What's going on?

Brett
02-23-2005, 10:47 AM
I cannot replicate this behavior. I imagine there there is a problem with your script. Whet if you make an empty project that just has:

Dialog.Message("Hello","World");

in the On Shutdown actions? Does it work then? I would suggest that you start with a simple case like this and then work your way back up again.

csd214
02-23-2005, 02:47 PM
Oh yeh, I have made a lot of simple project (some of them posted as examples here in the forum).

As I said, this is a project dependent error. It has not occurred all the time, but I did not observe when the error started. The installation is performed as expected. It is the uninstaller that has the problem (due to the fact that Actions.On Shutdown isn't executed.

I have been working with the project since 02/08/05. Thanks to Executive Software's Recovery Bin, I have tracked the development process: 02/17 12:32 OK – 02/17 12:35 Error, On shutdown skipped. I have to investigate these editions to find what's changed.

It was my hope that "Error - Setup did not complete successfully (5)" (and no other error) was enough for a hint...

csd214
02-24-2005, 03:15 AM
SUCCESS, I found the error!

The project from last week, Thursday 12:32, was OK. 3 minutes later the error occurred.

The significant modification:
After Installing.Screen Finished Install Successfully I modified the On Next code to:
-- advance to the next screen
--Screen.Next(); <-- Commented
Application.Exit(); <-- Added

The important rule:
When Application.Exit() is executed, the Shutdown procedure is skipped.
NEVER USE Application.Exit() IF THE RUNTIME EXECUTION HAS ENDED WITH SUCCESS. ALWAYS EXIT THE APP WITH Screen.Next().

Why did I add Application.Exit()? I have 4 screens After Installing:
1 Finished Successfully
2 Finished without success
3 A conditionally message (info) window
4 A conditionally message (info) window

On screen #1 (On Preload) I have my own tests for the success. If error jump to #2, otherwise display #1. This screen has buttons bringing the user to #3 or #4; both of them with a Back() button. (There are at least two methods to achieve the wanted result without using Application.Exit.)

Possible to replicate? YES, in every SUF70 project. Go to the last screen; add Application.Exit.

In another post (http://www.indigorose.com/forums/showpost.php?p=46718&postcount=8) I have emphasized the importance of UNDERSTANDING the program flow in SUF70. I used my SUF70 Program Flow.sf7 as a test. The setup log should end like this:

Success Display screen: Finished Install
*AppCtr* ================================================= (10)
Notice Start project event: On Shutdown
*AppCtr* ================================================= (11)

*AppCtr* The actions after the next line are performed AFTER 'On Shutdown':
Success Run project event: On Shutdown
Success Delete image file: (3 files)
Success Setup complete

With Application.Exit the lines in red are missing. The last line reads:
Error Setup did not complete successfully (5)

I assume that skipping the On Shutdown actions is an intended procedure in SUF70.

Suggestions:
i) Add a warning in the docs
ii) Add an entry in the log: Notice Appplication.Exit is executed
ii) Expand the last log entry:
Print an informative message; not only the return code.
(Return code 5 = "The installation was aborted by the user.")


In my project the shutdown actions are necessary to set a session variable to be used in the uninstall procedure. I have to use a session variable because UninstallData.GetItem() does not work as an uninstall action (previously reported in Oct (http://www.indigorose.com/forums/showpost.php?p=41962&postcount=6) and Dec (http://www.indigorose.com/forums/showthread.php?t=9627) 2004).