|
|
|
|
#1 |
|
Member
Join Date: Jan 2003
Posts: 79
|
Removing parent directories
Our current installation installs our product to something like:
C:\Program Files\CompanyName\ProductName During the uninstall, PHP Code:
Is there a smart way to remove the folder CompanyName? As far as I can tell there is no way to capture which directories are being created by the installer. Hardcoding PHP Code:
Also, doing something like PHP Code:
Suggestions? |
|
|
|
|
|
#2 |
|
Senior Member
|
|
|
|
|
|
|
#3 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
You can use GetParent from the useful functions appendix (or from the link rainwater posted), use it on $INSTDIR and if what comes out is $PROGRAMFILES\CompanyName then you can delete it. I suggest you don't use /r so whatever the user put in there will stay.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#4 |
|
Member
Join Date: Jan 2003
Posts: 79
|
Right, but that is pretty much the same thing as the RMDIR $R0\.. option.
What I need to know is whether or not the parent was created by the installer, what would be usefull (a suggestion) is that NSIS somehow keeps track of the files/directories it created, so they can be removed during the uninstall. I'm certain this is how most installers/uninstallers handle it. |
|
|
|
|
|
#5 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
That's not the same as $R0\.. because you check against $PROGRAMFILES\CompanyName. If you want to know exactly which directories were created you can make a little recursion that will take the directory path apart and try to create every directory from the smallest part to the largest and final part. Use the latest CVS version and IfErrors after you create the directory to know if it was created or not. Save that somewhere and delete it upon uninstallation.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#6 |
|
Member
Join Date: Jan 2003
Posts: 79
|
Right, but comparing it against CompanyName won't work if the user has entered in anoter value for "CompanyName". Right?
That's a good suggestion about creating the directories manually. Thanks
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|