Returning the installation results

Antworten
cshields
Beiträge: 12
Registriert: 03 Dez 2008, 04:32

Returning the installation results

Beitrag von cshields »

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
Benutzeravatar
d.oertel
uib-Team
Beiträge: 3319
Registriert: 04 Jun 2008, 14:27

Re: Returning the installation results

Beitrag von d.oertel »

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
opsi support - uib gmbh

For productive opsi installations we recommend support contracts.
http://www.uib.de
http://www.opsi.org
cshields
Beiträge: 12
Registriert: 03 Dez 2008, 04:32

Re: Returning the installation results

Beitrag von cshields »

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
Benutzeravatar
r.roeder
uib-Team
Beiträge: 540
Registriert: 02 Jul 2008, 10:08

Re: Returning the installation results

Beitrag von r.roeder »

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)
GetRegistryStringValue ([HKLM\software\Microsoft\Windows\CurrentVersion\Uninstall] xy)

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,
cshields
Beiträge: 12
Registriert: 03 Dez 2008, 04:32

Re: Returning the installation results

Beitrag von cshields »

This worked perfectly! Assigned the registry to a variable and then just checked for equality within that variable.

Thanks for the tip!
Antworten