User rights can cause headaches for the installation developer. For example, you are writing an installation for an application that consists of:
This causes problems since the installation writes a file to the System32 folder, which is locked down for non-administrator users. To complete the installation, you can do one of the following:
To implement the third option, elevate security rights of the installation by using either:
RUNAS (Windows 2000 and later)
SU (Windows NT 4)
This simple command line utility lets an external process execute with the rights of the username passed on the command line. This places the per-computer portions of the installation in a silent WiseScript that executes as part of the main installation. Running this command results in a single-user .exe that modifies both per-computer and per-user sections of the registry correctly.
To use the command line utility:
UserID is the user who runs the application and domain is the domain or computer name where the user resides.
Because the RUNAS command does not pass a password on the command line, do not select Hidden from Window Size if a password is needed to execute the installation. Sanur, a free utility, lets you pipe a password to RUNAS so the installing user does not have to enter in an administrator password at runtime.
By using a command line utility, you can create clean, easy-to-run installations for all users.