I've noticed in a couple of instances that an msi installation freezes or fails yet OPSI marks it as "Installed". Is there a way to script a success or failure result variable or something similar in the winst script to better inform OPSI of the installation status?
TIA!
-Corey
Returning the installation results
Re: Returning the installation results
Hi cshields,
yes, you should check the success of the installation.
If the installation is failed, you should call:
isFatalError
which stops the execution of the script and returns a 'failed' as installation state.
For examples see our script template:
http://download.uib.de/opsi3.3/produkte ... 1.0-7.opsi
or test the exit code of a winbatch call (opsi-winst manual):
– getLastExitCode
returns the ExitCode – also called ErrorLevel – of the last winbatch call
see also:
http://msdn.microsoft.com/en-us/library/aa368542.aspx
http://msdn.microsoft.com/en-us/library ... S.85).aspx
does this help ?
regards
detlef oertel
yes, you should check the success of the installation.
If the installation is failed, you should call:
isFatalError
which stops the execution of the script and returns a 'failed' as installation state.
For examples see our script template:
http://download.uib.de/opsi3.3/produkte ... 1.0-7.opsi
or test the exit code of a winbatch call (opsi-winst manual):
– getLastExitCode
returns the ExitCode – also called ErrorLevel – of the last winbatch call
see also:
http://msdn.microsoft.com/en-us/library/aa368542.aspx
http://msdn.microsoft.com/en-us/library ... S.85).aspx
does this help ?
regards
detlef oertel
opsi support - uib gmbh
For productive opsi installations we recommend support contracts.
http://www.uib.de
http://www.opsi.org
For productive opsi installations we recommend support contracts.
http://www.uib.de
http://www.opsi.org
Re: Returning the installation results
Yes, this is what I'm looking for, thanks..
wInst can test for FileExists but is there a way to test for the existence of a registry key? I don't see such a boolean described in the wInst manual. I wouldn't want to rely on a file existence alone, but for some packages the combination of a file and a registry key would be a nice test. (something from HKLM\software\Microsoft\Windows\CurrentVersion\Uninstall would be a sure bet)
If there isn't such a test I could get by with a DosBatch call that dumps results to a file and then check with LineExistsIn. Something akin to RegistryExists would be pretty nice though.
Cheers!
-Corey
wInst can test for FileExists but is there a way to test for the existence of a registry key? I don't see such a boolean described in the wInst manual. I wouldn't want to rely on a file existence alone, but for some packages the combination of a file and a registry key would be a nice test. (something from HKLM\software\Microsoft\Windows\CurrentVersion\Uninstall would be a sure bet)
If there isn't such a test I could get by with a DosBatch call that dumps results to a file and then check with LineExistsIn. Something akin to RegistryExists would be pretty nice though.
Cheers!
-Corey
Re: Returning the installation results
GetRegistryStringValue ([HKLM\software\Microsoft\Windows\CurrentVersion\Uninstall] xy)cshields hat geschrieben:
a way to test for the existence of a registry key?
HKLM\software\Microsoft\Windows\CurrentVersion\Uninstall would be a sure bet)
tries to read the value belonging to the entry xy in key HKML\...
If there is no such an entry the function returns the empty string (cf. winst manual 6.3.7).
I hope, this is sufficient as an existence test (although the same result is produced if the key exists but the value indeed is the empty string).
Greetings,
Rupert
Hi Corey,
Re: Returning the installation results
This worked perfectly! Assigned the registry to a variable and then just checked for equality within that variable.
Thanks for the tip!
Thanks for the tip!