You may want to create a portable launcher (wrapper) for a software that needs a .dll or other (i.e. .ocx) library files to be registered. With NSIS it is not a big deal registering them.
You may see some .dll files copied to the Windows or WindowsSystem32 (or other) directories during the installation (in Total Uninstall’s changes log). First you should try to copy this file or files to the program’s directory, next to the main exe file (in the “Appdata” directory if you use the same directory structure as I). If solves the problem in most cases because softwares can use those dll files from their directories if they find it there (provided if the software is programmed so).
If you test your portable and you get an error message that some dll or other files are missing, you have to copy these files to their original installed location before the main executive starts (see topic “File Management” in this chapter on how to copy files). You shouldn’t overwrite any files in the Windows or other directory because you may overwrite newer files with older ones. To eliminate this problem, make a backup of original files by renaming it before copying and restoring their names on closing the portable, or copying it to the USB drive and at the and copying it back.
If you modify your portable in this way, the error message(s) should disappear and your portable should work. But in some cases, you should see another error message:
“downloadthewholeinternet.dll is not registered”
That’s because you have to register that dll file before launching the main exe. To do this, use the following code:
RegDLL “$EXEDIRAppdatadownloadthewholeinternet.dll”
As you can see it is very straightforward. And it is safe because it uses the dll file that is located on your USB drive. When the the main exe is closed, the launcher should unregister that dll to keep the host PC clean:
UnREGDLL “$EXEDIRAppdatadownloadthewholeinternet.dll”
Alternatively, you can use this method:
ExecWait ‘regsvr32.exe /s “$EXEDIRAppdatadownloadthewholeinternet.dll”‘
This method uses the “regsvr32.exe” file located in the “WindowsSystem32″ directory. The “/s” switch stands for silent mode, so you’ll see nothing when regsvr32.exe register that dll. To unregister, use
ExecWait ‘regsvr32.exe /u /s “$EXEDIRAppdatadownloadthewholeinternet.dll”‘
code, where “/u” switch stands for “ungregister”.
To see what switches are available, double-click on “WindowsSystem32regsvr32.exe”.
Note that I used ExecWait here but you can use Exec action also. But because ExecWait waits until the executed process is closed, it is better to use it here. Also note the quotes used here. The whole command is wrapped around with single quote (‘) to ensure the whole expression is evaluated together.
[...] 8. Registering Libraries [...]