I need to detect if the machine should be rebooted because files are staged or files and DLLs are pending for the system directory. This is only necessary for Windows NT and later. I seem to recall information is stored in a few registry keys/values, but I can't detect them or recall what they are. I can manage getting the code into a DLL or in Installshield, I just need the starting point. Please provide some links or further information. Thanks.
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.
Pending File Operations
Started by
Blake Miller Wonder
, Mar 05 2002 20:56
13 replies to this topic
Posted 06 March 2002 - 01:20
My understanding is NT(and later) will record that information here:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\FileRenameOperations
Good luck!!!
DAnny
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\FileRenameOperations
Good luck!!!
DAnny
Posted 07 March 2002 - 02:30
With that in mind, I'm wondering if there is a more general entry for when an install requires rebooting???
I've only tried one install since learning of this location, but, despite requiring a reboot, it didn't write anything to this area of the registry.
Any ideas would be appreciated. Thanks in advance.
I've only tried one install since learning of this location, but, despite requiring a reboot, it didn't write anything to this area of the registry.
Any ideas would be appreciated. Thanks in advance.
Posted 07 March 2002 - 21:35
BugFarmer had the entry I was looking for.
Two others are:
HKEY_LOCAL_MACHINE\Software\Microsoft\Widnows\CurrentVersion\RunOnce
and
HKEY_LOCAL_MACHINE\Software\Microsoft\Widnows\CurrentVersion\RunOnceEx
If there are values in there, it is a good bet your machine should be rebooted!
In my case, the RunOnce were empty, but the pending file operations was not.
Two others are:
HKEY_LOCAL_MACHINE\Software\Microsoft\Widnows\CurrentVersion\RunOnce
and
HKEY_LOCAL_MACHINE\Software\Microsoft\Widnows\CurrentVersion\RunOnceEx
If there are values in there, it is a good bet your machine should be rebooted!
In my case, the RunOnce were empty, but the pending file operations was not.
Posted 07 March 2002 - 21:58
While I've never needed to work with this, isn't the BATCH_INSTALL variable useable for this?
From what I've read, if there is a reboot needed, BATCH_INSTALL equals a Non-Zero value. Can anyone confirm this?
SC
From what I've read, if there is a reboot needed, BATCH_INSTALL equals a Non-Zero value. Can anyone confirm this?
SC
Posted 08 March 2002 - 00:10
From the help topic, it certainly looks like IS's BATCH_INSTALL system variable would state whether such was the case.
My question though was a more general one since the install I'm referring to is done by a 3rd party, so I don't have access to its system variable.
As suggested though, I'll check out the RunOnce and RunOnceEx entries.
However since this third party is a vendor, I may end up just getting with them to figure out the exact conditions in which they require a reboot or have them publish something which I can check to know whether or not it's necessary.
My question though was a more general one since the install I'm referring to is done by a 3rd party, so I don't have access to its system variable.
As suggested though, I'll check out the RunOnce and RunOnceEx entries.
However since this third party is a vendor, I may end up just getting with them to figure out the exact conditions in which they require a reboot or have them publish something which I can check to know whether or not it's necessary.
Posted 16 June 2003 - 19:59
In another particular case, we have an IS 5.53 setup and BATCH_INSTALL is true, but we want to know WHY it is true.
How do we detect what file needed to be replaced but was locked?
In this instance all three registry locations previously discuussed are empty on a Windows 2000 Professional SP3 system.
How do we detect what file needed to be replaced but was locked?
In this instance all three registry locations previously discuussed are empty on a Windows 2000 Professional SP3 system.
Blake Miller @ Wonderware
Posted 16 June 2003 - 21:09
Hope some of this info can help…It comes from my copy of the InstallShield Training manual.
For each file group containing files that may be in use, set the Potentially Locked property to Yes in the Files Groups pane of the IDE.
If a locked file is encountered during installation, InstallShield copies the file to the target system with the file extension “.tmp” (or “.1” with IS5), and commits the file for installation for when the system is rebooted. As you know, InstallShield sets the Boolean system variable BATCH_INSTALL to the value TRUE if any locked files were encountered. Your script should call SdFinishReboot if BATCH_INSTALL is TRUE, otherwise call SdFinish.
On Windows 9x, installation of locked files works by creating a WinInit.ini file that runs when the system is rebooted; the initialization file moves the formerly locked files, and renames the “.tmp” (or “.1” IS5) files to their original names. On Windows NT, InstallShield calls the Windows API MoveFileEx to create registry values under the key HKEY_LOCAL_MACHINE_SYSTEM\CurrentControlSet\Control\Session Manager, in the value named PendingFileRenameOperations, which specify how to replace the locked files the next time the system is rebooted. (The data stored in the value PendingFileRenameOperations is of the Windows NT-only data type REGDB_STRING_MULTI, and can be viewed with the registry editor Regedit32.)
For each file group containing files that may be in use, set the Potentially Locked property to Yes in the Files Groups pane of the IDE.
If a locked file is encountered during installation, InstallShield copies the file to the target system with the file extension “.tmp” (or “.1” with IS5), and commits the file for installation for when the system is rebooted. As you know, InstallShield sets the Boolean system variable BATCH_INSTALL to the value TRUE if any locked files were encountered. Your script should call SdFinishReboot if BATCH_INSTALL is TRUE, otherwise call SdFinish.
On Windows 9x, installation of locked files works by creating a WinInit.ini file that runs when the system is rebooted; the initialization file moves the formerly locked files, and renames the “.tmp” (or “.1” IS5) files to their original names. On Windows NT, InstallShield calls the Windows API MoveFileEx to create registry values under the key HKEY_LOCAL_MACHINE_SYSTEM\CurrentControlSet\Control\Session Manager, in the value named PendingFileRenameOperations, which specify how to replace the locked files the next time the system is rebooted. (The data stored in the value PendingFileRenameOperations is of the Windows NT-only data type REGDB_STRING_MULTI, and can be viewed with the registry editor Regedit32.)
Posted 16 June 2003 - 22:13
Yes, thanks for taking the time to type that in.
I will look for the existence of such temporary files.
I will look for the existence of such temporary files.
Blake Miller @ Wonderware
Posted 17 June 2004 - 07:19
how can i read the key PendingFileRenameOperations when it is a REGDB_STRING_MULTI. RegDBGetKeyValueEx returns only the first string in this multistring. how can i read all strings of the key ?
Posted 17 June 2004 - 08:01
I once had a similar problem and found that StrGetTokens can break a multi-string into string when using "" as delimiter ...
Look into the help for StrGetTokens and GetProfString.
hope this helps ...
Look into the help for StrGetTokens and GetProfString.
hope this helps ...
Gruß / regards
Thomas
Thomas
Posted 17 June 2004 - 08:04
the problem is, RegDBGetKeyValueEx returns only the first string.
if i had the whole string i could use your function. is there an other
function to read the whole value of a reg-key ?
thanks for help
if i had the whole string i could use your function. is there an other
function to read the whole value of a reg-key ?
thanks for help
Posted 17 June 2004 - 12:51
are you sure?
If you look into the result string of GetProfString when searching for all keys in a section, you will see only the first one (it is delimited by \0, so after the first string, the text isn't shown ...).
But try to use StrGetTokens on the result string ... it may have more contents than you can see.
Good luck!
If you look into the result string of GetProfString when searching for all keys in a section, you will see only the first one (it is delimited by \0, so after the first string, the text isn't shown ...).
But try to use StrGetTokens on the result string ... it may have more contents than you can see.
Good luck!
Gruß / regards
Thomas
Thomas
Posted 17 June 2004 - 12:57
sorry. i used the debug window. it don't show the whole string. :-( so i thought that it is not complete. but it is complete and i used strgettokens.
thanks for help.
thanks for help.