Option "/norestart" doesn't work
Hi everybody,
I want to launch the follow command:
msiexec /fu {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} /norestart
... to reinstall all per user based registry settings.
But the Option "/norestart" doesn't work [X(]. In the .msi Package the option "Reboot" ist set to "force", but the "/norestart" must overwrite this setting. Or?
Thanks for help
privat
I want to launch the follow command:
msiexec /fu {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} /norestart
... to reinstall all per user based registry settings.
But the Option "/norestart" doesn't work [X(]. In the .msi Package the option "Reboot" ist set to "force", but the "/norestart" must overwrite this setting. Or?
Thanks for help
privat
0 Comments
[ + ] Show comments
Answers (18)
Please log in to answer
Posted by:
WiseUser
19 years ago
I felt bad about not spotting your problem sooner (and I had a few spare minutes) - so I wrote you a script.
Const sPRODCODE = "{17DAB648-906B-4C29-B296-6FD780708377}"
Const sREBOOTMODE = "ReallySuppress"
Const msiViewModifyUpdate = 2
Const msiOpenDatabaseModeDirect = 2
Set oInst = CreateObject("WindowsInstaller.Installer")
sDBPath = oInst.ProductInfo(sPRODCODE, "LocalPackage")
Set oDB = oInst.OpenDataBase(sDBPath, msiOpenDatabaseModeDirect)
sQuery = "SELECT `Value` FROM `Property` WHERE `Property` = 'REBOOT'"
Set oView = oDB.OpenView(sQuery)
oView.Execute
Set oRecord = oView.Fetch
oRecord.StringData(1) = sREBOOTMODE
oView.Modify msiViewModifyUpdate, oRecord
oView.Close
oDB.Commit
Set oInst = Nothing
Obviously, you need to change the sPRODCODE constant to reflect the ProductCode of your package.
This should change the value of the REBOOT property within the property table of the locally cached MSI. Unfortunately, it the script must be executed by a user who has at least "change" permissions to the local MSI (a local admin). You could use your deployment tool (SMS or other).
Once the script has been executed, your local MSI (in "C:\Windows\Installer") should have been changed, and you should find that running your "/fu" command should work (don't use the "v" flag).
Const sREBOOTMODE = "ReallySuppress"
Const msiViewModifyUpdate = 2
Const msiOpenDatabaseModeDirect = 2
Set oInst = CreateObject("WindowsInstaller.Installer")
sDBPath = oInst.ProductInfo(sPRODCODE, "LocalPackage")
Set oDB = oInst.OpenDataBase(sDBPath, msiOpenDatabaseModeDirect)
sQuery = "SELECT `Value` FROM `Property` WHERE `Property` = 'REBOOT'"
Set oView = oDB.OpenView(sQuery)
oView.Execute
Set oRecord = oView.Fetch
oRecord.StringData(1) = sREBOOTMODE
oView.Modify msiViewModifyUpdate, oRecord
oView.Close
oDB.Commit
Set oInst = Nothing
Obviously, you need to change the sPRODCODE constant to reflect the ProductCode of your package.
This should change the value of the REBOOT property within the property table of the locally cached MSI. Unfortunately, it the script must be executed by a user who has at least "change" permissions to the local MSI (a local admin). You could use your deployment tool (SMS or other).
Once the script has been executed, your local MSI (in "C:\Windows\Installer") should have been changed, and you should find that running your "/fu" command should work (don't use the "v" flag).
Posted by:
WiseUser
19 years ago
Posted by:
sini
19 years ago
Posted by:
private
19 years ago
Thanks for the answers.
-> WiseUser
Yes, Windows Installer 3.0
-> sini
I try it on Monday (I am curently not at work). THX!
The background:
I have create a little .vbs that reinstall all user based settings for all .msi package are install at current machine. All works fine, except the "none-restart" [8|]
Greetings from Germany.
-> WiseUser
Yes, Windows Installer 3.0
-> sini
I try it on Monday (I am curently not at work). THX!
The background:
I have create a little .vbs that reinstall all user based settings for all .msi package are install at current machine. All works fine, except the "none-restart" [8|]
Greetings from Germany.
Posted by:
WiseUser
19 years ago
Posted by:
private
19 years ago
Posted by:
WiseUser
19 years ago
Posted by:
WiseUser
19 years ago
Posted by:
private
19 years ago
OHHH YES, thats is !!! :)
After I execute your nice script I can do this:
On Error Resume Next
Dim fso, Datei,line, command,tmp
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Product",,48)
Set WSHShell = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
Set Datei = fso.CreateTextFile("c:\testfile.txt", True)
For Each objItem in colItems
'Wscript.Echo "IdentifyingNumber: " & objItem.IdentifyingNumber
If (objItem.IdentifyingNumber="{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}" or objItem.IdentifyingNumber="{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}" or objItem.IdentifyingNumber="{CB2F7EDD-9D1F-43C1-90FC-4F52EAE172A1}" or objItem.IdentifyingNumber="{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}") Then
Else
Datei.WriteLine(objItem.IdentifyingNumber)
Set oExec = WshShell.Exec("msiexec /fuq "& objItem.IdentifyingNumber)
Do While oExec.Status = 0
WScript.Sleep 100
Loop
End If
Next
Datei.Close
Yes, your contribution was very useful!!! Thanks!
private greetings from germany
After I execute your nice script I can do this:
On Error Resume Next
Dim fso, Datei,line, command,tmp
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Product",,48)
Set WSHShell = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
Set Datei = fso.CreateTextFile("c:\testfile.txt", True)
For Each objItem in colItems
'Wscript.Echo "IdentifyingNumber: " & objItem.IdentifyingNumber
If (objItem.IdentifyingNumber="{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}" or objItem.IdentifyingNumber="{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}" or objItem.IdentifyingNumber="{CB2F7EDD-9D1F-43C1-90FC-4F52EAE172A1}" or objItem.IdentifyingNumber="{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}") Then
Else
Datei.WriteLine(objItem.IdentifyingNumber)
Set oExec = WshShell.Exec("msiexec /fuq "& objItem.IdentifyingNumber)
Do While oExec.Status = 0
WScript.Sleep 100
Loop
End If
Next
Datei.Close
Yes, your contribution was very useful!!! Thanks!
private greetings from germany
Posted by:
WiseUser
19 years ago
Posted by:
private
19 years ago
Posted by:
WiseUser
19 years ago
I know exactly what that error is... The MSI in question has no "REBOOT" property set so the field cannot be found in the property table.
The script will work on your "Adobe Photoshop 6.0.1" package because it has been set to "Force".
The script could be modified to create the "REBOOT" property, but this shouldn't be necessary for your purposes. It is unlikely that a "u" repair will need to replace in-use files.
The script will work on your "Adobe Photoshop 6.0.1" package because it has been set to "Force".
The script could be modified to create the "REBOOT" property, but this shouldn't be necessary for your purposes. It is unlikely that a "u" repair will need to replace in-use files.
Posted by:
WiseUser
19 years ago
No problem!
I said I'd have a look at your script - I wouldn't have used WMI myself but I suppose that's just personal choice.
Here's what mine would have looked like (I haven't included a log file in mine):
Const sPRODCODE = "{350C97B0-3D7C-4EE8-BAA9-00BCB3D54227}"
Const msiUILevelNone = 2
Const msiReinstallModeUserData = 256
Set oInst = CreateObject("WindowsInstaller.Installer")
'oInst.UILevel = msiUILevelNone
Set oProdLst = oInst.Products
For Each sProdID in oProdLst
If sProdID = sPRODCODE Then oInst.ReinstallProduct sProdID, msiReinstallModeUserData
Next
Set oProdLst = Nothing
Set oInst = Nothing
I've remarked out the line that makes the repair "silent" otherwise you can't see anything happening!
I said I'd have a look at your script - I wouldn't have used WMI myself but I suppose that's just personal choice.
Here's what mine would have looked like (I haven't included a log file in mine):
Const msiUILevelNone = 2
Const msiReinstallModeUserData = 256
Set oInst = CreateObject("WindowsInstaller.Installer")
'oInst.UILevel = msiUILevelNone
Set oProdLst = oInst.Products
For Each sProdID in oProdLst
If sProdID = sPRODCODE Then oInst.ReinstallProduct sProdID, msiReinstallModeUserData
Next
Set oProdLst = Nothing
Set oInst = Nothing
I've remarked out the line that makes the repair "silent" otherwise you can't see anything happening!
Posted by:
private
19 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.