PDA

View Full Version : Run Program after user chooses no restart Windows



markwa
07-30-2007, 02:36 PM
Hello,

Upon completion of the installation, the user is asked whether to restart Windows, and also the installed app is automatically run. The user is incorrectly presented with two windows at the same time: (1) the dialog box asking him whether to restart Windows, and (2) the install application window.

How can I postpone the displaying of the application window until after the user decides to not restart Windows?

I found some Jan'2005 forum discussion on this:

http://www.lindersoft.com/forums/showpost.php?p=3548&postcount=3

The advice there was to make "Run Program" the last statement in the script. I tried that, but it didn't work:


[ Final User Interface ]
! Final wizard dialog definition(s)
Define Wizard Dialog "#1" (Finish)

! The Wizard Loop displays the dialog screens that the user sees in the installation
Loop Wizard (Abort Dialog Active)
End
Run Program %_SB_INSTALLDIR%\[PRODUCTSHORTNAME]\[PRODUCTSHORTNAME].exe -wndtoptemp (Always Install)

Cheers
-- Mark

linder
08-01-2007, 03:53 AM
Hello Mark,

If the installer asks for a reboot, the installation is not complete. I would suggest to NOT allow the installer to run the program if a reboot is required.

What you can do is to disable the the checkbox (undocumented feature)

[ Final User Interface ]
! Final wizard dialog definition(s)
Define Wizard Dialog "#1" (Finish)
If %_SB_INSTALLERFLAG% Equals "1" on Position "$SB_RESTARTFLAG$" Then
Disable Control ID 4081
End

Then "disable" the execute function:

If %_SB_INSTALLERFLAG% Not Equals "1" on Position "$SB_RESTARTFLAG$" Then
Run Program %_SB_INSTALLDIR%\[PRODUCTSHORTNAME]\[PRODUCTSHORTNAME].exe -wndtoptemp (Always Install)
End

Does this help?

Friedrich

markwa
08-01-2007, 10:34 PM
Hello Friedrich,

> If the installer asks for a reboot, the installation is not complete. I would
> suggest to NOT allow the installer to run the program if a reboot is required.

That makes sense. The real problem then is this: Why does the setup want the user to restart Windows? How can I learn what condition(s) triggered setup to want to require the user to restart Windows?

Cheers
-- Mark

linder
08-02-2007, 12:11 AM
Hi Mark,

If the installer replaced a "locked" (in-use) file, it has to restart the OS.

Does this help?

Friedrich

markwa
08-02-2007, 11:21 AM
Hello Friedrich,

> If the installer replaced a "locked" (in-use) file, it has to restart the OS.

That does seem to describe the majority, if not all, of the cases where the setup would need to restart Windows.

Is there a way for me to find out what files are locked, thus prompting the setup restart?

Cheers
-- Mark

linder
08-04-2007, 05:13 AM
Mark,

After the installation process, all files to be replaced at restart are listed here:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Session Manager\PendingFileRenameOperations

To find out *before* you install file, you can use the "Check In-use Folder Tree" script function.

Does this help?

Friedrich

markwa
08-06-2007, 12:55 PM
Hello Friedrich,

> After the installation process, all files to be replaced at restart are listed here:
>
> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Session Manager\PendingFileRenameOperations

On a Vista setup, I was asked whether to restart Windows. I responded no. But there were no entires under FileRenameOperations (not PendingFileRenameOperations).

Is there any other reason that the setup wants the user to restart Windows other than renaming files?

Cheers
-- Mark

linder
08-07-2007, 07:48 AM
Hello Mark,

If you do not have a "Reboot/Resume..." script function in your script, then the answer is no. The installer only asks for a reboot if it has to replace a locked file. The MoveFileEx Windows API handles this automatically.

Friedrich

linder
08-07-2007, 08:05 AM
Hello Mark,

By the way, is this a Vista32 or Vista64 machine? If it is a Vista64 machine, did you check the 32-bit registry entries?

Friedrich

markwa
08-16-2007, 11:45 AM
Hello Friedrich,

This is a Vista32 machine, where I didn't find any entries in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Session Manager\FileRenameOperations

Cheers
-- Mark

linder
08-17-2007, 09:11 AM
Hello Mark,

I'll develop a test program to check this here on our Vista32 machine. I'll get back to you.

Friedrich

linder
08-19-2007, 06:37 AM
Hi Mark,

I have tested this on three different Vista Ultimate machines and the registry entries are created (see attached screenshot). The installer replaced a "locked" sbuilder.chm file located in c:\test.

Does this help?

Friedrich