PDA

View Full Version : Reboot and Resume After .NET 4.7.1 Installer



jalopy
08-14-2018, 10:46 AM
I have an InstallScript project that requires .NET 4.7.1.
In the Prerequisite Editor under Behavior I have selected the following for "If the prerequisite appears to need a reboo"t:

Reboot the machine and resume on reboot


When the installer is run and the .NET installer starts, an entry is added to the RunOnce key so that setup.exe can be run again after reboot.
The problem is the value points to a setup.exe in the TEMP directory (C:\Users\user\AppData\Local\Temp\1). This directory is deleted after reboot so the setup can't be resumed.



I remember reading that the RunOnce key is set to the instance of setup.exe that started the installer. After checking Process Explorer I found that my setup.exe called another copy of itself in that same TEMP directory.
This is the command it uses:

C:\Users\user\AppData\Local\Temp\1\{C04E4397-8C86-4766-9943-9078317535BC}\setup.exe -no_selfdeleter -IS_temp -media_path:"C:\path_to_project\build\Release1\Disk Images\Disk1\" -tempdisk1folder:"C:\Users\user\AppData\Local\Temp\1\{C04E4397-8C86-4766-9943-9078317535BC}\" -IS_OriginalLauncher:"C:\path_to_project\build\Release1\Disk Images\Disk1\setup.exe"

Why is the setup.exe copied to the TEMP directory and run from there?
Is there a way to set the RunOnce key value to the original directory?