Archive: Uninstall From... another Directory


Uninstall From... another Directory
Hi,

i use the modern ui and install my software for example in D:\MySoftware. I create the uninstaller in C:\WINDOWS\MySoftware\uninstall_mysoftware.exe.

If I execute the uninstaller I see on the confirmation page the uninstall directory "C:\WINDOWS\MySoftware". I would change this to "D:\MySoftware". How can I change this?

Best regards

Rainer


Please read manual 4.8.1.21 InstallDir and 4.8.1.22 InstallDirRegKey, this should help you ;) Included to distribution script samples (like Examples\example2.nsi) can help you as well.


Hi,

thanks for your answer. But this doesn´t help. I have set InstallDir in my installer. For Example:

-------
InstallDir "D:\MySoftware"

/* INSTALL SECTION */
SetOutPath $INSTDIR
File "C:\test"

/* AT this point i create the _uninstaller_ in another directory */
CreateDirectory "$WINDIR\MySoftware"
WriteUninstaller "$WINDIR\MySoftware\uninstall_mysoftware.exe"
-------

If I now execute my _uninstaller_ i can see on the confirm page "Uninstalling From: C:\WINDOWS\MySoftware". Now I would change this "Uninstalling From: C:\WINDOWS\MySoftware" to "Uninstalling From: D:\MySoftware"

Regards

Rainer


In installer

InstallDirRegKey HKLM Software\YourCompany\YourProduct Install_Dir
...
WriteRegStr HKLM Software\YourCompany\YourProduct Install_Dir "$INSTDIR"

In uninstaller
ReadRegStr $INSTDIR HKLM Software\YourCompany\YourProduct Install_Dir

May be I'll add last string ot my scrpts :)

Hi,

yes that works.

Thx

Rainer