View Full Version : Rebooting, not coming back as expected

05-24-2018, 11:20 AM
InstallShield 2018- Windows 10 LTSB-N - InstallScript

I am working on a setup program that shells out (LaunchApplication) and installs several other installations. Some of them require the PC to be rebooted. I have the RunOnce working when I swapped back to "Exit"s and got rid of the "Abort"s after the reboot setting. " System(SYS_BOOTMACHINE); exit;" My problem is when the setup program starts up, I am using commandlines to goto to the next line of code to execute. See below sample of code. In a simple test setup, it works great. The running of different setup programs is defined by the components selected, and that is working great without the reboots. When I moved it into the larger complicated setup program, I run into several issues:

My issues are:
1. After the reboot the setup program is now in maintains mode.
2. If I capture the command line in the OnReboot function, the last "Prerequisites" comes up and wants to be re-installed. It doesn't recognize my command line and the redirection.
3. The /d to use "bebug" appears to be ignored when I am capturing in the command line in an if statement.

The setup for a reboot:

if (RegDBSetKeyValueEx(szKey,"RunSetup", REGDB_STRING, SRCDIR ^ "\\Setup.exe -test2", -1) < 0) then
MessageBox ("RegDBGetKeyValueEx failed (-test2)", SEVERE);
MessageBox("2nd Reboot is setup to run", INFORMATION);

Command line Processing:
szKey = "Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce";

MessageBox("Start of Test Program", INFORMATION);
if(CMDLINE = "") then
MessageBox("Empty Command Line", INFORMATION);
goto dlg_Welcome;
elseif(CMDLINE = "-test1") then
MessageBox("Test 1 after reboot", INFORMATION);
goto Stp_Test1;
elseif(CMDLINE = "-test2") then
MessageBox("Test 2 after reboot", INFORMATION);
goto Stp_Test2;

1.Where do I want to put my command line processing code, in what event?
2. Can I change the mode from Maintenance back to initial state? How?
3. Is there something special I need to do to get the debug to work if processing the command line?

Thanks in advance for the help,