Add Item After Reboot

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • gott
    Forum Member
    • Sep 2007
    • 32

    Add Item After Reboot

    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
    Indigo Rose Staff Member
    • May 2000
    • 2149

    #2
    To do the reboot it may be as simple as setting

    Code:
    _NeedsReboot = true;
    or

    Code:
    System.Reboot();
    Now to make a program run after reboot you can use the action File.RunOnReboot(). You may need to make this file a separate executable to make your changes after the system has rebooted.

    Adam.

    Comment

    • gott
      Forum Member
      • Sep 2007
      • 32

      #3
      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.

      Comment

      • Adam
        Indigo Rose Staff Member
        • May 2000
        • 2149

        #4
        Yes you certainly could set a flag to do this operation upon reboot. You could use Application.SaveValue() and Application.LoadValue() actions.

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

        Code:
        Application.SaveValue("Yourcompany", "setupComplete", true);
        Then your code on Startup could look something like this:

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

        Comment

        Working...
        X