Archive: Walk a directory structure in reverse


Walk a directory structure in reverse
Apologies if something similar has already been asked - I couldn't find anything close in the archives.
My installer runs and allows the user to select a directory in the $SMPROGRAMS folder.
I would like to structure the default like so:
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "${MUI_PRODUCT_FAMILY}\${MUI_PRODUCT_NAME}"
(having pre-defined FAMILY and NAME, this works fine).
Where I'm having trouble is walking back up this directory structure at uninstall time, deleting folders created (ifEmpty).
Nuking the trailing folder is simple, but how do I "walk" up a (potentially variable) folder structure deleting as I go? ie. how would I parse the variable stored in the "Start Menu Folder" reg key and reverse walk it, deleting as I go, making no assumptions about how "deep" this structure might be?

If anyone cares to have a stab at this, can I be so bold as to ask for code snippets (I'm a definite newbie)?

TIA,
-Sean.


For resursive delete, use RMDir /r.


You can either use the GetParent function or use this code:

DetailPrint $TEMP
GetFullPathName $0 $TEMP\..
DetailPrint $0

[QUOTE]You can either use the GetParent function or use this code:[QUOTE]

Perfect! Thanks for pointing that out to me, and apologies for wasting your time by not seeing it whilst poring over the docs.

-Sean.