[wpkg-users] Registry key import

Rainer Meier r.meier at wpkg.org
Mon Dec 8 12:43:04 CET 2008


Hi Bram,

Bram Bosboom wrote:
> I just discovered something where registry imports fail if a variable is
> used (the software variable which works for normal installs for example).
> I do see some examples on the wiki where a variable is used to import a
> key so I guess I am missing something here..
> 
> A simple example package I have is where I want to import some WSUS keys
> to deploy on some workstations;
> 
> *snap*
>     <check type="registry" condition="exists"
> path="HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate"
> />
>    
>     <install cmd='regedit /s "%SOFTWARE%\wsus\securewsus.reg"' />
> *snap*
> 
> The regfile itself is working OK. And whole package does get run.


Actually WPKG exptands all variables within a cmd string before
executing. Are you sure your SOFTWARE variable is set in WPKG client?

You could debug using a shell script.

In general I never liked the 'regedit' method at all. Since quite a
while there are is the 'reg' tool which provides direct access to
registry to scripts. So I am usually running a cmd script which is doing
the job.

You might consider using a CMD script as well:

@echo off
reg import "%SOFTWARE%\wsus\securewsus.reg"

If it still fails it's much easier to debug. For example check if the
%SOFTWARE% variable points to the right location:

@echo off
echo SOFTWARE location: %SOFTWARE% >> %TEMP%\debug.txt
reg import "%SOFTWARE%\wsus\securewsus.reg"


Try it and report if %SOFTWARE% is resolved correctly.


br,
Rainer



More information about the wpkg-users mailing list