Skip to content
⌘ NSIS Forum Archive

nsExec::Exec Problem on Uninstall

7 posts

dabossuk#

nsExec::Exec Problem on Uninstall

Hi

In my main section I call

nsExec::Exec "cmd /c $INSTDIR\regasm.exe /codebase /tlb
mbloxsdk.dll"
nsExec::Exec "cmd /c $INSTDIR\regsvr32.exe /u mbloxwrappers.dll"

The above works fine ... and registers my components. Note that I do NOT pass in $INSTDIR - if I do it does not work. The files are in the root of the installer.

I am then calling the following section on uninstall :

Section "Uninstall"

;Unregister my components

Banner::show /NOUNLOAD "un-Registering .NET and COM Components ...."

nsExec::Exec "cmd /c $INSTDIR\regasm.exe /unregister $INSTDIR\mbloxsdk.dll"
nsExec::Exec "cmd /c $INSTDIR\regsvr32.exe /u $INSTDIR\mbloxwrappers.dll"

Sleep 3000

Banner::destroy

******

However when I uninstall I have to call with a $INSTDIR otherwise exec comes up with an error saying it cannot find the files. If I put in $INSTDIR it does not create an error - but also does not unregister my components - I can check in the registery and they are still there. If I do the same commands from a dos prompt manually it works fine ...

Any ideas ?? Thanks

Dabossuk
Joost Verburg#
To register your dll, you should use RegDLL.

Why do you call CMD? It will only work on Windows NT and will cause a lot of extra problems. Calling regsvr32.exe directly is possible, but that won't work on the first Windows 95 version.
dabossuk#
Hi

I could use Reg and Unreg for the COM DLL - but that does not solve the problem of the .NET component where I have to use Regasm.exe - which is the same as regsvr32 but for .NET components (I assume that reg and unreg does not support regasm.exe?)

Dabossuk
dabossuk#
just read again what you posted ... could I just call regasm.exe instead of CMD in nsExec::Exec ?