Page 1 of 1

Show icon in System tray causes error on reboot

Posted: Mon Nov 29, 2010 12:37 pm
When a system requires the installation of a pre-requisite (e.g. .Net Framework), which in turn requires a reboot the 'Show icon in System Tray, minimize setup to system tray' throws an error of 'Cannot create shell notification icon', and then quits the install.

Additional information:
IA Version; 9 r2
Win OS: Windows XP Pro SP3
Show Icon command is executed in an included script, if that matters.

any help is appreciated,

Steve

Re: Show icon in System tray causes error on reboot

Posted: Tue Nov 30, 2010 8:17 pm
by mills
I was able to work around this with the following approach:
//This was placed at the start of the script:

Does File Exist $DATADIR$\hasReboot.txt (get result into variable hasReboot)
MessageBox: hasReboot, hasReboot = $hasReboot$
if Variable hasReboot not Equals TRUE
Show icon in system tray, minimize setup to system tray
end

...

//This was added before any reboot commands:

Write into Text File $DATADIR$\hasReboot.txt from Value yes (at end of file)
Reboot Computer and Resume Setup

...

//You can add a delete files command immediately before Apply Install:

Delete Files $DATADIR$\hasReboot.txt (when installing)
Apply Install (get result into variable SUCCESS)
If you're using a compressed build, $SFXPATH$ would be a reasonable path to use, but DATADIR seemed least obvious to the user that it was being used.

You can also use DeleteFileA in kernel32.dll using Call DLL Function to delete the file. It'd be a good idea to place that before Terminate Installs, in case a user cancels the setup after prereqs are installed.