I am trying to silently uninstall an MSI install via my installsheild 7 based inststaller. Everything works but I don't know when the msi install wants to reboot. And beyond that I would like to tell it to not reboot and I'll handled it.
So does anyone know how to detect a reboot request from an MSI uninstsall and force it not to reboot?
This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.

How do you detect .MSI reboot requests from IS7?
Started by
BrianF
, Mar 05 2004 18:42
3 replies to this topic
Posted 29 March 2004 - 21:38
If you are not using iss files, then I don't have an answer to your problem.
However, lets assume you are using a iss file to uninstall your MSI application.
If this is the case, record an uninstall which does not reuiqre a reboot. Then, record an normal uninstall which needs a reboot and answer 'No' to the reboot question.
Append the answers to the reboot dialog from the 'reboot needed' silent install file to the end of the 'no reboot' silent install file.
When you uninstall using this new silent install file, make sure you specify the 'f2' parameter to record the log file in a known location.
Once the uninstall is complete, you can check the log file to see if a reboot is scheduled. If that is the case, set the BATCH_INSTALL variable to TRUE and the user will be asked to rebbot at the end of the IS Pro7 installation.
Good luck,
However, lets assume you are using a iss file to uninstall your MSI application.
If this is the case, record an uninstall which does not reuiqre a reboot. Then, record an normal uninstall which needs a reboot and answer 'No' to the reboot question.
Append the answers to the reboot dialog from the 'reboot needed' silent install file to the end of the 'no reboot' silent install file.
When you uninstall using this new silent install file, make sure you specify the 'f2' parameter to record the log file in a known location.
Once the uninstall is complete, you can check the log file to see if a reboot is scheduled. If that is the case, set the BATCH_INSTALL variable to TRUE and the user will be asked to rebbot at the end of the IS Pro7 installation.
Good luck,
The Eskimo
"Evil shall come upon thee, which thou shalt not know how to deprecate"
- Robert Lowth, eighteenth-century Bishop of Winchester
"Evil shall come upon thee, which thou shalt not know how to deprecate"
- Robert Lowth, eighteenth-century Bishop of Winchester
Posted 30 March 2004 - 08:31
You can use the command line parameter REBOOT=ReallySuppress to suppress the MSI reboot. You can check the exit code to see if a reboot is required.
Stefan Krüger
InstallSite.org twitter facebook
Posted 20 April 2004 - 20:03
Thanks. I actually really wanted to know if the reboot was pending so I could force it if needed and surpress it if there were other things needed. I found this fuction somewhere and modified it a little.
///////////////////////////////////////////////////////////////////////////////
// ISC_bRebootPending - Returns TRUE if a reboot is needed. This function looks
// for values in the PendingFileRenameOperations value in the
// Registry on Windows NT/2000. If the operating system is
// Windows 9x, this function looks for values in Wininit.ini.
///////////////////////////////////////////////////////////////////////////////
function BOOL ISC_bRebootPending()
NUMBER nvType, nvSize;
STRING svValue;
BOOL bRetVal;
// Return value
LONG lOS;
LIST listRunOnceVals;
begin
bRetVal = FALSE;
// Assume a reboot is not required
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
RegFlushKey(HKEY_LOCAL_MACHINE);
GetSystemInfo (OS, lOS, svValue);
if (lOS = IS_WINDOWS9X) then
// In Windows 9x, file rename operations are stored in Wininit.ini
// under the section name "rename". Get a list of rename values,
// and if there are any, a reboot is pending.
if (Is(FILE_EXISTS, WINDIR ^ "Wininit.ini") = TRUE) then
if (GetProfString(WINDIR ^ "Wininit.ini", "rename", "", svValue) = 0) then
if (StrLength(svValue) > 0) then
bRetVal = TRUE;
endif;
endif;
endif;
else
// In Windows 2000 and Windows NT, file rename operations are stored in
// the PendingFileRenameOperations value. If there is any data in that
// value, a reboot is pending.
if (RegDBGetKeyValueEx(REG_SESSION_MANAGER, REG_PENDINGFILERENAMEOPERATIONS, nvType, svValue, nvSize) = 0) then
if (nvSize > 0) then
bRetVal = TRUE;
endif;
endif;
endif;
// Look for any values in the RunOnce key. If any values exist, a reboot
// is pending.
listRunOnceVals = ListCreate(STRINGLIST);
RegDBQueryKey(RUNONCE, REGDB_NAMES,
listRunOnceVals);
if (ListCount(listRunOnceVals) > 0) then
bRetVal = TRUE;
endif;
ListDestroy(listRunOnceVals);
return bRetVal;
end;
///////////////////////////////////////////////////////////////////////////////
// ISC_bRebootPending - Returns TRUE if a reboot is needed. This function looks
// for values in the PendingFileRenameOperations value in the
// Registry on Windows NT/2000. If the operating system is
// Windows 9x, this function looks for values in Wininit.ini.
///////////////////////////////////////////////////////////////////////////////
function BOOL ISC_bRebootPending()
NUMBER nvType, nvSize;
STRING svValue;
BOOL bRetVal;
// Return value
LONG lOS;
LIST listRunOnceVals;
begin
bRetVal = FALSE;
// Assume a reboot is not required
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
RegFlushKey(HKEY_LOCAL_MACHINE);
GetSystemInfo (OS, lOS, svValue);
if (lOS = IS_WINDOWS9X) then
// In Windows 9x, file rename operations are stored in Wininit.ini
// under the section name "rename". Get a list of rename values,
// and if there are any, a reboot is pending.
if (Is(FILE_EXISTS, WINDIR ^ "Wininit.ini") = TRUE) then
if (GetProfString(WINDIR ^ "Wininit.ini", "rename", "", svValue) = 0) then
if (StrLength(svValue) > 0) then
bRetVal = TRUE;
endif;
endif;
endif;
else
// In Windows 2000 and Windows NT, file rename operations are stored in
// the PendingFileRenameOperations value. If there is any data in that
// value, a reboot is pending.
if (RegDBGetKeyValueEx(REG_SESSION_MANAGER, REG_PENDINGFILERENAMEOPERATIONS, nvType, svValue, nvSize) = 0) then
if (nvSize > 0) then
bRetVal = TRUE;
endif;
endif;
endif;
// Look for any values in the RunOnce key. If any values exist, a reboot
// is pending.
listRunOnceVals = ListCreate(STRINGLIST);
RegDBQueryKey(RUNONCE, REGDB_NAMES,
listRunOnceVals);
if (ListCount(listRunOnceVals) > 0) then
bRetVal = TRUE;
endif;
ListDestroy(listRunOnceVals);
return bRetVal;
end;