cscript \\server\wpkg\wpkg.js /synchronize /quiet /nonotify >nil
== Your examples use a server with WPKG share accessible by everybody. My server is password protected or is a Domain Controller and I can't access it without first logging to it. How can I configure WPKG to access a username/password protected share? ==
This is an advanced setup, and somehow unsecure (keeping passwords in plain files) - think of it as just an idea.
Certainly you should consider easier and safer installation methods before.
An easy way to do so is to run WPKG service as domain\domainusername.
An alternative way is below.
Considering, you are running Samba, and your WPKG share is configured like below:
[wpkg]
comment = Windows Packager
path = /home/samba/wpkg
read only = yes
browseable = no
valid users = unattended
guest ok = no
which means, that only user unattended can access that share, you have to configure your clients to access/mount this share *before* cscript.exe is instructed to run wpkg.js.
This means you have to do the following:
1) setup different registry entries on your clients with a different install-service.js file,
2) create a directory not accessible by normal users, which will contain a file with username and a password to access WPKG share,
3) instead of accessing our share using \\server\wpkg\packages, we will mount them as W:\
install-service.js file for username/password protected shares should look like below:
var WshShell = WScript.CreateObject("WScript.Shell");
var srvKey = "HKLM\\SYSTEM\\CurrentControlSet\\Services\\Windows Packager\\Parameters\\";
var appKey = srvKey + "Application";
var srvPath = "C:\\NETINST\\wpkg-start.bat"
WshShell.RegWrite(appKey, srvPath, "REG_SZ");
Then, on a Windows client, create a directory C:\NETINST - it has to be accessible by Administrator and SYSTEM account *only*.
cacls /? from a command line on your client explains how to set up access permissions on files and directories.
Next step is to create a C:\NETINST\wpkg-start.bat file, which will mount username/password protected WPKG shares, execute wpkg.js, download files if necessary, and unmount the shares. This is the content of this file:
net use W: \\server\wpkg /user:domain\unattended password
cscript W:\wpkg.js /synchronize /quiet
net use W: /delete
See net use /? for a description of other options for mounting shares under Windows.
Note that you might also change your wpkg-install.bat file (described in Documentation) and add similar net use entries, entries which will create C:\NETINST directory with necessary permissions, change the paths etc.
The last step is to edit your packages.xml definitions.
Instead of accessing packages using \\server\wpkg\packages path, we have to use W:\packages. So just change something like:
<install cmd="msiexec /i \\server\wpkg\packages\acrobatreader6\AdobeReader6.0.msi /q allusers=1">
to:
<install cmd="msiexec /i W:\packages\acrobatreader6\AdobeReader6.0.msi /q allusers=1">
and everything should work flawlessly with a username/password protected server.
[[category:Documentation]]
[[category:Installation]]