Jump to content

Reboot after install then resume script


 Share

Recommended Posts

Hi.

Is it possible to reboot afer installing alcohol120%, and after reboot that the script will resume the installation?

I searched the forum, found some french input but dont understand it, so i can only read the script.

It has something to do with register, but i dont have a clue how that works.

Is there anyone here who can help me?

I want to know how to resume installation after a reboot.

Thanks alot

Edited by cotax
Link to comment
Share on other sites

You can add an entry to the HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce key before the reboot. It needs to be a REG_SZ the name doesn't matter, just give it some random name. The data should contain the path to your script. For example:

RegWrite("HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce", "after_alcohol", "REG_SZ", @ScriptFullPath)
Link to comment
Share on other sites

This is an old script I made for Daemon Tools which maybe similar to Alcohol as they both use the SPTD driver which needs to be installed 1st, then reboots and then the main application installs. If similar, then you may need to use the "HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce" key to handle the main application install as the Alcohol120 registry entry maybe in the same key.

So you could call a function like this to add the registry entry to restart your script at the correct time when the desktop loads.

Func _RunOnce()
    ; Add 2nd part to installation.
    Local $key = 'HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce'
    RegWrite($key, '_Alcohol120', 'Reg_sz', '"' & @AutoItExe & '" /AutoIt3ExecuteScript "' & @ScriptFullPath & '" /postrun')
EndFunc

Set the script to check for the /postrun switch on restart to handle the install as needed.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...