Prev Previous Post   Next Post Next
Old 20th February 2003, 20:58   #1
tderouin
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:
  RMDir /"$INSTDIR
will only remove the ProductName folder, leaving an empty CompanyName folder.

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:
  RMDir /"$INSTDIR"
  
RMDir /"C:\\Program Files\\CompanyName" 
isn't a viable solution, because the problem still exists for non-default installations that have subfolders (and this problem also exists for removing shortcuts).

Also, doing something like
PHP Code:
StrCpy $R0 $INSTDIR
loop
:
      
RMDir "$R0"
      
IfErrors goto done
      StrCpy 
"$R0" "$R0\\.."
      
goto loop
done

isn't a (completely) viable solution because you might end up deleting an empty directory the installer didn't create, that the user doesn't want deleted.

Suggestions?
tderouin is offline   Reply With Quote
 
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump