Skip to main content

Configuration files and locations

Introduction

Print Wizard relies on certain files to configure it in general, and to configure certain print jobs. These files might be in several places, which can be very confusing. Here I'll try to make sense of it all.

Some background

We used to store things in the same directory as Print Wizard. By default, this was "c:\Program Files\PrintwizXX". However, starting with Vista, this location was often protected by Windows, and files that were placed there were virtualized (by Windows) to another place. So it was really easy to lose them! Consequently, we started playing by the rules, and putting them where Microsoft wanted us to.

There was also an issue of multiple users of one PC needing different configurations. This might happen if different users logged in to Windows at different times. or more commonly, in a Terminal Services environment.

Finally, when a service (as defined in Print Wizard) is run as a Windows service, it is often run as a special user name, such as "LOCAL SYSTEM". This user had to be able to "see" the configuration files.

Microsoft's approach

First, Windows has a concept (similar to Unix) of environment variables. A variable can have a value within each process space. You can see all the variables and their values if you open a CMD prompt (a "DOS box"), and type
   set

You can ask Windows to translate a variable to its value in many places by wrapping the variable name with percent signs. For instance, in a CMD prompt I can type:
   cd %temp%
and it will CD me to "C:\Documents and Settings\Bob\Local Settings\temp". You can also enter a variable name this way in Windows Explorer, or in most File Open boxes.

Now MS wants me to store my own application data in the directory pointed to by the APPDATA variable, and data for all users in the directory pointed to by the ALLUSERSPROFILE variable, then the "Application data" folder beneath that (if running on XP).

The values of APPDATA and ALLUSERSPROFILE are different in different versions of Windows.

Print Wizard 4's behavior

This version of Print Wizard prefers to store configuration data in one of two places. Data for all users is stored in
   %ALLUSERSPROFILE%\Application data\Print Wizard 4
(if you're on Windows XP), or
   %ALLUSERSPROFILE%\Print Wizard 4
(if you're on Vista or Windows 7), and data for a specific user is stored in
   %APPDATA%\Print Wizard 4

Let's call these two locations ALLUSERDATA and USERDATA, respectively. Remember that the USERDATA location is dependent on the username by which you're logged in to Windows.

When any Print Wizard program runs (except for some trivial programs), it looks for these directories, and creates them if they're not there (and it has permission). This means it does not require an installer to build these directories.

Two other locations are possible: EXECDIR, which is the directory containing whatever executable (EXE) is running; and CWD, the Current Working Directory, also known as the "start in" directory.

Print Wizard programs except for Print Wizard User Interface (PWUI.exe) look for configuration files in a certain order:

  1. USERDATA
  2. ALLUSERDATA
  3. EXECDIR
  4. CWD

Once it finds a particular file, it stops looking.

In the PWUI program, though, you have a choice. When you start it up (usually from the desktop icon), it will ask you whether you want to save settings for "all users". If you say NO, it will use the sequence above. But if you say YES, it will first look (call it priority zero) in ALLUSERDATA. The title bar for PWUI will indicate if it's in "All users" mode. You can change the mode in the Edit menu by checking or unchecking "Save for all users".

The files Print Wizard uses

In the end there are only a few files that Print Wizard uses:

  1. The defaults file, named printwiz.ini, contains overall configuration data, such as what your fax number is.
  2. The services file, named pwservices.ini, contains the service definitions.
  3. The optional master profile file, named master.profile, can set initial assumed values for any settings that are normally contained in a profile file.
  4. There can be zero, one, or many profile files, named something.profile. Each of these is a set of settings for how a job should be handled (printed, faxed, made into PDF, etc.).

Important to note, each of these files is an editable text file. Once you find it, you can edit it in Notepad. This is a "back door" way to make complex configuration changes. You can also compare one profile to another (with the FC command, for instance) to see what has changed.

Most of the Print Wizard programs will tell you, in their debug output, where they are finding each of these files.
 

Copyright © 2024 Rasmussen Software, Inc. Legal Information & Privacy Policy
Send comments and suggestions to rsi@anzio.com