Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Using a Reg Key to run an installer on startup

Options
  • 13-07-2011 4:14pm
    #1
    Registered Users Posts: 17,771 ✭✭✭✭


    Hey, apologies if this isn't where this ought to go, I'm a noob.

    I currently have an unattended installer for Windows XP, that executes an installer package the first time the computer starts up, something along the lines of:
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce]
    "Install"="c:\\install\\utils\\Install.bat"
    

    I'm trying to modify this setup so that the above is run the first time the computer boots, and a second installer gets run on the second boot.

    I guess I need to use the "Run" key instead of the RunOnce key, with some sort of batch script along these lines:
    State=1
    Run=cscript ScriptName.js
    

    Then in ScriptName.js:
    if( state == 1 )
    {
              Install first_package
              Increment state reg setting
    {
    else if( state == 2 )
    {
              Install second_package
              Delete ‘Run’ registry setting
    }
    

    Any suggestions or thoughts on this approach?

    TY


Advertisement