HOW TO: Perform silent (un)install of Directory Opus

Summary: In a corporate environment you often want to install or uninstall software silently, with no input from the user.

Current versions (InnoSetup installers):

In early 2020, we switched to using InnoSetup instead of InstallShield. Instructions on how to automate InnoSetup installers can be found here:

Only the installers marked for Windows XP users still use InstallShield. If you are using those, or installing an older version, please see the first reply to this post, below.


Automatically installing a registration certificate (All installer types):

After the main program installation is done, you still need to install the registration certificate, so that Opus is not running in time-limited evaluation mode. This can be automated using the /cert and /regcode arguments to dopus.exe (the main Directory Opus executable):

"C:\Program Files\GPSoftware\Directory Opus\dopus.exe" /cert <cert filename> /regcode <registration code> /norun

The <cert filename> must be the full filename of the certificate text file (a text file containing your program certificate, including the ---BEGIN and ---END lines). If this filename contains spaces, make sure you enclose it in quotation marks.

The certificate must also be a purchased one. Free evaluation certificates will not work with silent installs.

The <registration code> is a sequence of letters and numbers which you can find at the top of the certificate file.

The /norun argument in the example prevents Opus from starting once the certificate has been installed; you can remove the /norun argument if you want Opus to start as part of the install.

Note: This command only works if dopus.exe is not already running. If the command causes an Opus window to open instead, check that dopus.exe isn't already running in the background (e.g. from previous testing of your install script) and exit it if it is.

Example:

"C:\Program Files\GPSoftware\Directory Opus\dopus.exe" /cert "dopus_cert.txt" /regcode AAAAA-BBBBB-CCCCC-DDDD /norun

(The reg-code in that command is one character shorter than a real one. This is because the forum is configured to censor anything which looks like a real reg-code, to stop people pasting theirs in public messages.)


Automatically importing a configuration (All installer types):

If you also wish to import an Opus configuration as part of your install script then you can easily do so in one of two ways.

Config import via manual file copy:

The Opus preferences, toolbars, etc. are all stored in files to make it easy for you to copy them.

See the separate FAQs on Opus configuration files: Basic Details and Advanced Details.

Config import via Backup & Restore:

You can also have Opus automatically import a configuration file that you create using the Preferences / Backup & Restore command.

To do this, make your install batch file start Opus with the /config argument on the command line. For example:

"C:\Program Files\GPSoftware\Directory Opus\dopus.exe" /config "c:\temp\opus config.ocb"

You can also prevent the "New User" dialog from appearing the first time the user runs Opus, by setting a registry value using the following command:

reg add "HKCU\Software\GPSoftware\Directory Opus" /f /v ConfigType /t REG_SZ /d "private"
1 Like

Older versions (InstallShield installers):

Until early 2020, Directory Opus used the standard InstallShield system which supports silent installation via an 'answer file'.

The steps below apply to Directory Opus 9, 10, 11 and older 12 installers unless otherwise noted.


Silent install (Legacy InstallShield):

Download the installer and extract its contents to a folder (called "OpusInstall" in this example) using the /extract_all argument:

DOpusInstall.exe /extract_all:"OpusInstall"

Within the folder you extracted to, under a "Disk1" sub-folder, you'll find setup.exe and various data files. To generate a "response file" (aka "answer file") you need to run this extracted setup.exe (and not the original downloaded installer) with the -r argument:

setup.exe -r

When you run that it will look like the normal installer, and Opus will be installed on the machine you are using. The difference is that the responses you give to the installer's questions will be saved into the 'answer file' which can then be used to supply the same answers during silent installs.

The "response file" will be written to C:\Windows\setup.iss (or wherever your Windows folder is) by default. After creating the response file you should copy it to the same place as the extracted setup files from the first step.

With the response file in the same folder you can run the extracted setup.exe with the -s argument to perform silent installs:

setup.exe -s

After the main program installation is done, you still need to install the registration certificate, so that Opus is not running in time-limited evaluation mode. This can be automated using the /cert and /regcode arguments to dopus.exe (the main Directory Opus executable):

"C:\Program Files\GPSoftware\Directory Opus\dopus.exe" /cert <cert filename> /regcode <registration code> /norun

The <cert filename> must be the full filename of the certificate text file (a text file containing your program certificate, including the ---BEGIN and ---END lines). If this filename contains spaces, make sure you enclose it in quotation marks.

The <registration code> is a sequence of letters and numbers which you can find at the top of the certificate file.

The /norun argument in the example prevents Opus from starting once the certificate has been installed; you can remove the /norun argument if you want Opus to start as part of the install.

Note: This command only works if dopus.exe is not already running. If the command causes an Opus window to open instead, check that dopus.exe isn't already running in the background (e.g. from previous testing of your install script) and exit it if it is.


In summary, once the response file (setup.iss) has been created, the automated install of Directory Opus would probably be a script file which runs the following commands:

setup.exe -s
"C:\Program Files\GPSoftware\Directory Opus\dopus.exe" /cert "dopus_cert.txt" /regcode AAAAA-BBBBB-CCCCC-DDDD /norun

(The reg-code in that command is one character shorter than a real one. This is because the forum is configured to censor anything which looks like a real reg-code, to stop people pasting theirs in public messages.)

Updating from versions older than Opus 11.13:

Directory Opus 11.13 and later cannot be silent-installed over the top of Opus 11.12 or earlier, without first uninstalling the older version.

This is due to a new installer architecture introduced in Opus 11.13, to move from separate 32-bit and 64-bit installers to a single unified installer.

Once 11.13 or above is installed, updating to later versions should work as before, so this is just a one-off due to the installer change. (Tested with the 11.13 to 11.13.1 update, at time of writing.)

Remember to re-make your setup.iss files with the new installer.


Silent Uninstall (Legacy InstallShield):

This works in almost the same way as the silent install, except you add the /uninst argument when running the extracted setup.exe.

You should do this with the same installer version you wish to uninstall, if possible. (If you need historic installer binaries, please ask on the forum.)

If you've already set up silent installs then you already have the extracted installer files. If not, extract them as per the instructions above (DOpusInstall.exe /extract_all:"OpusInstall", etc.).

With Opus installed on your machine, run the extracted uninstaller interactively, to generate a response file.

setup.exe -r /uninst

Note: You may want to make sure Opus is running when you do this, so the files are in-use, causing the uninstaller to prompt for a reboot and record your yes/no answer as part of the response file. That will be closer to the typical situation on a user's machine.

The response file will be saved to C:\Windows\setup.iss by default (the same as it was for the install case).

Move the response file so it is next to your setup.exe. (If you want to keep just a single copy of the extracted installer binaries, you could do that and store the two response files in separate folders, moving in the one you want as needed.)

With the response file in place, you can now do a silent uninstall:

setup.exe -s /uninst

The uninstall should not be considered complete until the machine has rebooted, unless you can ensure it is done when no user is logged into the machine interactively.

Doing an uninstall will wipe the configuration data of the user who runs it (and possibly all users on the machine if run by an admin with access to their profiles). Be sure to backup configurations first if you intend the uninstall to be temporary rather than forever.

1 Like