PDA

View Full Version : Add Item After Reboot


gott
10-31-2007, 08:49 AM
I need to add the following to an installer that I have created:

1. After clicking on Finish, the installer program needs to inform the user that the computer must be rebooted.

2. After reboot, a file will need to be altered based upon a registry setting

I have all of the code in place to perform the second operation, I just need some guidance or examples of how I can achieve the requirement for rebooting and, once rebooted, adding the option to change parameters of a file. Thanks.

Adam
10-31-2007, 09:48 AM
To do the reboot it may be as simple as setting

_NeedsReboot = true;

or

System.Reboot();

Now to make a program run after reboot you can use the action File.RunOnReboot() (http://www.indigorose.com/webhelp/suf70/Program_Reference/Actions/File.RunOnReboot.htm). You may need to make this file a separate executable to make your changes after the system has rebooted.

Adam.

gott
10-31-2007, 10:30 AM
For the file itself, is there any way to set some sort of flag in order for the initial installer to perform the file alteration upon reboot? All I need to do is to change a specific line within a text file based on where an application's home directory resides. Unfortunately, this does not seem to work during the initial install, as the registry entry is not picked up then. I would rather not create another executable just to change a line within a text file. Thanks.

Adam
11-01-2007, 12:23 PM
Yes you certainly could set a flag to do this operation upon reboot. You could use Application.SaveValue() (http://www.indigorose.com/webhelp/suf70/Program_Reference/Actions/Application.SaveValue.htm) and Application.LoadValue() (http://www.indigorose.com/webhelp/suf70/Program_Reference/Actions/Application.LoadValue.htm) actions.

So for example you could put this at the end of your install:


Application.SaveValue("Yourcompany", "setupComplete", true);


Then your code on Startup could look something like this:


value = Application.LoadValue("Yourcompany", "setupComplete");
if value ~= "" then
-- perform your task here
Application.Exit(0);
end


Adam Kapilik