PDA

View Full Version : About Uninstaller......


parag_NSIS
4th February 2009, 13:40
Hi,

I am installing one application through NSIS installer.
In one of the CustomPage I accepts the Directory paths from the user and I save it in the /Global variables. Now through application the files get copied to those folders.

Now while Uninstalling the application, I have to remove those folders from the system. But the variables I saved during installation gets out of scope when I start the Uninstaller.

How can I manage this to work for me? Is their any way to save those directories paths anywhere and get it while uninstalling the application?

MSG
4th February 2009, 13:52
The uninstaller does not remember the variables you used in the installer. You could save the variable contents to the registry during install, or save them to a text/ini file in the installation folder.

Anders
4th February 2009, 13:52
save it in the registry or in a .ini file and read them back in the uninstaller

parag_NSIS
5th February 2009, 04:42
Hello Anders/MSG,

Thanks for your reply.

I am using the following code to read the path from the registry and then delete it.

;Read the woring directories path from the registry
ReadRegStr $0 HKLM "software\AS101\AddressDir" "Created"
ReadRegStr $1 HKLM "software\AS101\WorkDir" "Created"
ReadRegStr $2 HKLM "software\AS101\SnapDir" "Created"
ReadRegStr $3 HKLM "software\AS101\FinishDir" "Created"
ReadRegStr $4 HKLM "software\AS101\ApprovalDir" "Created"
ReadRegStr $5 HKLM "software\AS101\WorkflowDir" "Created"

;Messagebox mb_ok "$0,$1,$2,$3,$4,$5"

RMDir /r "$0"
RMDir /r "$1"
RMDir /r "$2"
RMDir /r "$3"
RMDir /r "$4"
RMDir /r "$5"

I am getting the exact path to remove the Directory like D:\PRG\AddBDel for $0 and then so on.....
But the above code is not deleting the directories. What can be the issue? Can you please guide me?

parag_NSIS
5th February 2009, 04:55
Hi Anders/MSG,

It's working now.
I was saving in the resigtry with the path D:\\PRG\\AddBDel
That's why it was not getting deleted.
I made the path to D:\PRG\AddBDel and now it is working.