Windows UAC (User Account Control) can cause the client installation to fail with a message like the following:

You must have an administrative privilege to run this tool.

This happens even when being launched by an `Administrator'. The WPKG logs show this:

Error 1722. There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor. Action _A9459942_EE79_497A_9080_F39DDA8A7B80, location: C:\Program Files\wpkg\wpkginst.exe, command: --SETTINGSFILE=

The solution is to launch a command window with elevated privileges and use that to start the installer. Quoting from one post of many:

"WPKG user interface -> Show" switch to see GUI of programs started by WPKG Client. You will also want to configure detailed logging in config.xml. Also, in WPKG Client setup, add some command as "execute before" and "execute after" (commands like notepad.exe or cmd.exe) - it will pause executing until you close their windows.

I installed an application with WPKG. Then, I uninstalled that application manually, using Control Panel (Software Add/Remove). WPKG doesn't reinstall those applications, why?[edit]

You probably uninstalled a package which does not supply appropriate package checks. WPKG offers the possibility to verify the package installation-status by checking the uninstall entries as they show up in the control panel. If you remove a package where you did not define any check WPKG has no possibility to verify if the package is still installed properly. To prevent having to re-install the package each time a local settings file (wpkg.xml) will be maintained by WPKG. This file keeps track of all packages installed.

Therefore you should make sure that if ever possible your package contains meaningful checks which allows WPKG to detect an uninstalled package in a reliable way. In most cases an uninstall check or a file check on an essential application binary (e.g. the main executable) would do the job.

Again: If you do not specify any checks WPKG cannot verify the install state of a package. Therefore it will not be re-installed after manual remove. WPKG simply trusts the package entry within wpkg.xml. If you specify checks then it allows WPKG to detect a removed package.

Of course you can also manually remove the corresponding entry within wpkg.xml but this is not recommended. Instead you should probably provide a new version of the package with appropriate checks. WPKG will then detect that the new version is available and do an upgrade.

Just remove the entry of a previously with WPKG installed program from the respective profile in the profiles.xml. Next time the client synchronizes, the program will be uninstalled (if there is a valid uninstall command).

If you already checked that this file is really there, check this file for errors / typos. A common error could be missing quotation-marks ( " ), or if they are in a wrong place, or if there are two of them in a place only one is needed, or...

One cause for this is missing the MSXML2.domdocument.3.0 object. This will occur on a fresh install of Windows 2000 with IE5. Installing IE6 is the easiest solution - it will install the required component automatically.

Users of German version of Windows will get "Die Ereignisprotokolldatei ist voll".
Users of French version of Windows will get "Le journal d'�v�nements est plein".

As the error say, your Event log is full. Either clean it, or don't log what WPKG does to the Event Log.

WPKG logs to the Event Log when /quiet flag is used. So, don't use this flag, and start WPKG like below:

cscript \\server\wpkg\wpkg.js /synchronize /nonotify >nul

It is generally a good idea to start most of the <install cmd commands in a quiet way (there are sometimes quiet switches), or redirect their output to >nul. Examples of such commands are copy, xcopy, robocopy, del etc.

The problem can be avoided by changing the default settings for Windows logging, which are too small. Open the Event Viewer, select the Application Log, and choose Properties from the Action menu. You can increase the maximum log size and change the setting to overwrite events, so the log file will not get filled. You can probably set up a silent install package to make these changes on all your workstations by editing registry keys. See HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\logfile.

This is just a different symptom of the same problem as the previous question: If your command (xcopy, robocopy, unzip) is generating a lot of output, WPKG will need to capture it and this will take a lot of time.

I'm getting an error 'Input Error: There is no script engine for file extension ".js".', and WPKG won't start[edit]

If you have an HTML editor that has associated Javascript Source files (.JS) to it, then the CSCRIPT or WSCRIPT engine won't know which engine to use for the .js file. So, issue the following command from the command prompt to get it to work

C:\>ASSOC .JS=JSFile

Important: Make sure you have the capitalization correct... or else it could yell at you... especially the ".JS=JSFile".

Many of the silent installs are listed with %SOFTWARE% as a placeholder for the location of the installation files. If you wish to use the silent installs from this wiki, you must set the variable yourself. One way to do so is to add something like the following to one of your profiles:

It can also be set directly in the WPKG Client under the second tab called "Variable, actions". Click the New button, set the name to SOFTWARE and the value as a UNC path such as \\server\WPKG.

If your installation files are for licensed software then there may be something in the license that says you have to control access to the install files. If you set the %software% environment variable globally then any command prompt will reveal the location of these files. You can prevent this by setting the variable in the wpkg-start.bat batch file so that it only affects that "session". It also keeps all the environment variable settings for WPKG as part of the WPKG script and ensures the variable is set before the script runs.

WPKG 1.0 and up supports a logging feature where you can write a log file. You can use the /logLevel:<level> switch to change the amount of output written to the log file. The log level is actually defined using a bitmask. This allows you to independently enable logging of

errors

warnings

information

audit success

audit failure

However in productive environment it is recommended to use a logLevel setting of 3 to log errors and warnings only (some might also use a value of 7 to add informational output as well). Higher log levels will lead to lots of ugly debug output which is probably only useful for package debugging.

Note: You might set the logLevel="3" attribute at the profile node as well. This allows you to apply a different (probably debug-level) logLevel to the profile you're using in your testbed while keeping the default log level of 3 for productive use.

Please also note that the logLevel will only influence the amount of output written to the log file. It does not affect the amount of output written to the console. If you're running WPKG from the command-line logLevel will not have any effect on the output there. To receive debug output on the console you need to use the /debug command-line switch. This allows WPKG client to run WPKG in the background as a service without using the /debug flag but using the /silent switch so no output is written to an invisible console - instead administrators can control the amount of output written to the logs by specifying logLevel either on the called command line or (more convenient from my point of view) within config.xml.

There has been some proposals on Bugzilla to introduce several levels of debug logging in order to allow fine-grained control on the amount of logs written to the log files in debug mode. Even some patches have been posted to Bugzilla already.

However I am personally completely against such an "enhancement". From my point of view the log levels above are completely sufficient. In productive environment you will log errors, warnings and probably informational messages. On your test machines and for WPKG developers you will most probably enable debug logging to trace exactly what's happening inside WPKG. It looks like some people tried to use debug output in productive environment and of course there is too much output on debug level. So some people asked for a fine-grained debug-level setting.

Unfortunately such multiple debug levels create a maintenance nightmare. Even within a short discussion thread it showed that everyone has hes/hers own point of view how much output should be logged. I personally think that it would be impossible to satisfy the needs of everybody. Especially if there are no clear rules what exactly needs to be logged to which debug level which is an impossible thing to define for all future enhancements. Just imagine a new feature to be added to WPKG; the programmer adds some debug output - to which debug level should it be attached? I am absolutely sure if you're going to ask 10 people you will get as many different answers as log levels are available. Just a simple example is the logging of a list of packages read from the XML files. Somebody might argue that this should be printed within the lowest debug level since it's absolutely crucial for WPKG operation that the packages are correctly read. Somebody else might think this just blows up the log file with useless information since you know your XML files are correct and there will be no problem here.
As a result WPKG developers and administrators who need to debug will anyway use the highest available log level to debug in order to make sure not to miss the important parts. Such (technical) people are usually also able to handle such a huge amount of output using search, grep and other tools.

Another big drawback of a high amount of log levels is that log-files can show a huge amount of different detail level. Support requests posted to the WPKG support team might contain enough information for the administrator but not for the WPKG developers. So it will be anyway crucial to get a log file with the highest possible log level.

The log file size on a typical system (tested on my installations) is about 20-50kB. This size is still easily parseable and searchable.

Disadvantages of multiple debug log-levels:

If you really have to find a bug you will anyway set the log level to the highest available level in order to make sure you don't miss the important parts.

Everybody will anyway have a different view how much detail should be logged within a specific debug level.

The result is that administrators and developers will anyway use the hightest available log level to make sure all information is available.

Log files posted to the WPKG support (mailing list/Bugzilla) would potentially contain too less information.

Full debugging log is not that huge so it is still possible to handle it - so no need to reduce the amount of output.

Yes you can. By default WPKG writes a log file using the name pattern "wpkg-[HOSTNAME].log". This will overwrite the same log on each execution. This was desired in order to prevent filling up the HDD with lots of log files. However if you use a pattern like "wpkg-[HOSTNAME]-[YYYY]-[MM]-[DD]_[hh]-[mm]-[ss].log" will write a new log file if WPKG is executed one second later again (and it's very unlikely to execute it twice within the same second).

It's clear that using such a pattern you will get lots of log files within the log file folder. Therefore it's recommended to have some cleanup tasks running on that folder (log rotation, log aging) - see the question about log rotation.

Some people also asked for log file appending instead of overwriting. I have chosen the overwriting approach in order to prevent the log file growing to infinite. Additionally appending changes the modify date of a log file which creates some problems with some log rotating scripts. So it's much better to write a new log file on each execution.

WPKG itself does not contain built-in log rotation. I personally think this is a bad idea. Log rotating is not a core functionality of WPKG. Additionally there are numerous tools available which are specialized on rotating log files created by any application. Almost any Linux box already comes with a rotating tool like 'shrotate'.

Additionally there is a huge amount of ways to rotate log files. Some examples:

based on size

based on date

based on name

based on attributes

any combination of the ones above

Well rotating is a very complex thing and needs to be very flexible to fit the needs of each environment and the flavor of the administrator. There is a big amount of tools out there which can do the rotation independently of WPKG. These tools are dedicated to log rotation. It's an illusion that WPKG will ever be as flexible as such a tool. Additionally I am against re-inventing the wheel and incorporating code into WPKG which is unnecessary and is prone to errors and bugs.

So the suggestion is clearly to use an external log rotation script if you would like to retain several log files. Personally I am perfectly fine with the default settings to just keep a log of the last execution per machine so I can see all the messages and errors produced by that machine at the moment. I am not really interested to know what happened during an installation months ago - I am just interested in the current system state - which is actually represented by the local wpkg.xml and the last execution log.

The issue with variables showing up "raw" in logs and other output is intentional, as stated in a post to the wpkg-users mailing list. If you need to verify what a variable is expanding to, the recommended solution is to create a simple package whose install commands dump the variables to file, like this:

As of version 1.3.0, the priority of variable assignments has changed to the following (from lowest to highest: assignments done in locations listed first will be overridden by ones listed later):

Operating system environment variables

The "Variables, actions" tab of the wpkginst.exe client utility

Host XML files

Profile XML files

Package XML files

For example, if you assign a variable named foo in a Profile (priority 4), it will override any existing definitions in the Host (priority 3), or by variables on the client machine (priorities 1 and 2). It can, however, be overridden by an entry in the Package definition (priority 5).

Unfortunately there is a limitation of WSH which causes an executed child process to stall if the console buffer is full. The process stalls until the buffer is flushed. WPKG tried to implement proper buffer flushing to prevent this. Unfortunately the methods to check whether the buffer is empty is blocking too which means WPKG would stall when checking whether the buffer is to be flushed. Thus WPKG would be blocked and unable to check whether the command reached its timeout.