[wpkg-users] Window OS Version check?
Rainer Meier
r.meier at wpkg.org
Sat Jan 23 11:27:26 CET 2010
Hi Paul,
On 23.01.2010 11:04, Paul McGrath wrote:
> That is a really sophisticated method, I go for the simple method ;-)
>
> Using the logical checks that the OS is a particular version and the bit type matches 32 or 64bit from the registry
>
> <check type='logical' condition 'and'>
> <check type="registry" condition="equals" path="HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CurrentVersion" value="6.0" />
> <check type="registry" condition="equals" path="HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE" value="x86" />
> </check>
>
> XP = 5.1, Vista = 6.0 and Windows 7 = 6.1
> Processor Architecture is use x86 or AMD64, I havent put 64bit OS on an Intel dual core so I dont know that variable
>
> I have separate packages for XP and Vista (32 or 64) but put them all in the same profile and they'll install based on the checks.
I would not recommend this method. Personally I even feel that you might have
misunderstood the purpose of checks in WPKG.
Checks are there to verify that a package is installed properly on a system.
Using your checks WPKG will detect all packages with Vista-checks (example
above) to be installed already on the system.
For example if you assign the following two packages to all hosts:
<package id='InternetExplorerVistax86' name='Internet Explorer' revision='800' >
<check type='logical' condition 'and'>
<check type="registry" condition="equals"
path="HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CurrentVersion"
value="6.0" />
<check type="registry" condition="equals"
path="HKLM\SYSTEM\CurrentControlSet\Control\Session
Manager\Environment\PROCESSOR_ARCHITECTURE" value="x86" />
...
</check>
<package id='InternetExplorerXPx86' name='Internet Explorer' revision='800' >
<check type='logical' condition 'and'>
<check type="registry" condition="equals"
path="HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CurrentVersion"
value="5.1" />
<check type="registry" condition="equals"
path="HKLM\SYSTEM\CurrentControlSet\Control\Session
Manager\Environment\PROCESSOR_ARCHITECTURE" value="x86" />
..
</check>
Then XP hosts will detect InternetExplorerXPx86 to be installed already since
all registry entries are already there - as a result WPKG will not install
anything. Even worse it will execute the commands from the
InternetExplorerVistax86 because WPKG detects that the checks failed. So it will
try to install it. Of course the commands will fail and WPKG reports a "failed
to check after installation" error to event log. On each re-synchronization WPKG
will try to re-install all packages where the checks do not succeed.
So please remember that checks are NOT there to check if a package applies to
the system if the checks are true. Checks are there to verify that a package is
installed properly and WPKG will run the commands over and over again until
checks become true. In case of your checks they will never become true since the
package will for sure not change the PROCESSOR_ARCHITECTURE or CurrentVersion value.
More over such checks are completely unrelated to the software you're installing
WPKG will be unable to detect if something happens to the application (e.g. user
uninstalled it). So I really recommend using checks which verify that the
software is properly installed. This allows WPKG to detect any broken piece of
software on the machine and re-install it.
br,
Rainer
More information about the wpkg-users
mailing list