File copy during dpinst.exe

Hi Tim,

Thanks for the review. Would you know how do I register the uninstaller with NSIS?

All the best,

Angelos

xxxxx@purelifi.com wrote:

Thanks for the review. Would you know how do I register the uninstaller with NSIS?

Have you looked? MANY of the example scripts in the NSIS distribution
demonstrate this. I use a text substitution tool before I create the
script; @UNINSTALLER@ is the name of the uninstall executable to be
created (like “uninst_xxx.exe”) and @UNINSTALLERNAME@ is the friendly
name to be displayed in the Programs and Features control panel applet,
like “MyCompany MyProject Drivers”. The WriteUninstaller command tells
it to create an uninstaller and include it in the installer, and the
WriteRegStr commands create registry entries to add it to the list.

; Create the uninstaller.

WriteRegStr HKLM
“Software\Microsoft\Windows\CurrentVersion\Uninstall\MyProject” \
“DisplayName” “@UNINSTALLERNAME@”
WriteRegStr HKLM
“Software\Microsoft\Windows\CurrentVersion\Uninstall\MyProject” \
“UninstallString” ‘“$INSTDIR@UNINSTALLER@”’

WriteUninstaller “@UNINSTALLER@”

Then, of course, you need a
Section “Uninstall”
that includes all of the files to be removed. As I say, there are
samples to show this.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

> The ugly script trickery here is removing the quote marks to get the

path to DPInst:

That seems like overkill, in the uninstaller $InstDir is the path to the folder where your uninstaller .exe is located. You also have the more specific $ExeDir.

Also, before your loop you do “StrCpy $1 $0” but then treat $1 as a number. $1 will always be treated as 0 the first time you hit the loop if $0 begins with a quote. The 3rd and 4th StrCpy parameters can be negative but if that is what you want you might as well assign 0 to $1 IMHO.

On Jun 5, 2016, at 4:18 AM, xxxxx@techie.com wrote:

> The ugly script trickery here is removing the quote marks to get the
> path to DPInst:

That seems like overkill, in the uninstaller $InstDir is the path to the folder where your uninstaller .exe is located. You also have the more specific $ExeDir.

Yes, but that part is not running in the uninstaller. It’s in the installer, checking to see whether the uninstaller exists.

Also, before your loop you do “StrCpy $1 $0” but then treat $1 as a number.

Yes, it should be StrLen.

Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

I have adapted the installer and it works great. One question however is the following: After dpinst.exe finishes the installation, the following registry folder is getting created:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\44BD8E38D812182C11B90D9AC7218BDA11112BBC

The problem is that the last part of this key , e.g. 44BD8E38D812182C11B90D9AC7218BDA11112BBC is not defined in my code and I don’t know how to define it.

I have observed that after recompilation this code changes.

Would you know how this string is getting specified? I have read that it is ProductCode which is specified by the GUID. But I didn’t understand how to specify the GUID.

xxxxx@purelifi.com wrote:

I have adapted the installer and it works great. One question however is the following: After dpinst.exe finishes the installation, the following registry folder is getting created:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\44BD8E38D812182C11B90D9AC7218BDA11112BBC

The problem is that the last part of this key , e.g. 44BD8E38D812182C11B90D9AC7218BDA11112BBC is not defined in my code and I don’t know how to define it.

I have observed that after recompilation this code changes.

Would you know how this string is getting specified? I have read that it is ProductCode which is specified by the GUID. But I didn’t understand how to specify the GUID.

That’s being added by DPInst, and is a way to run “dpinst /u”
automatically. Since my clients found it confusing to have two
uninstall entries (one for my NSIS script, and one for DPInst), and
since I wanted to be in control, I learned that you can add
to your dpinst.xml configuration file to
suppress this.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Hi Tim, so there is no way to control this string?

xxxxx@purelifi.com wrote:

Hi Tim, so there is no way to control this string?

No, but why would you care? It will appear in “Programs and Features” as

Windows Driver Package – Xxxxxx.Inf (date time)

If the user runs that, the registry entry will be removed, along with
the driver package. If you don’t want to allow users to call that
separately, then just suppress it with the dpinst.xml configuration option.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.