<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://nsis.sourceforge.io/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Talk%3ARecursively_remove_empty_parent_directories</id>
	<title>Talk:Recursively remove empty parent directories - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://nsis.sourceforge.io/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Talk%3ARecursively_remove_empty_parent_directories"/>
	<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Talk:Recursively_remove_empty_parent_directories&amp;action=history"/>
	<updated>2026-04-22T09:51:34Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.17</generator>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=Talk:Recursively_remove_empty_parent_directories&amp;diff=20753&amp;oldid=prev</id>
		<title>Fkaatje at 12:26, 11 August 2011</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Talk:Recursively_remove_empty_parent_directories&amp;diff=20753&amp;oldid=prev"/>
		<updated>2011-08-11T12:26:16Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;â† Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 12:26, 11 August 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l43&quot;&gt;Line 43:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 43:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;FunctionEnd&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;FunctionEnd&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/highlight-nsis&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/highlight-nsis&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[User:Fkaatje|Fkaatje]] 12:26, 11 August 2011 (UTC)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key n22049_wiki-wiki_:diff::1.12:old-20752:rev-20753 --&gt;
&lt;/table&gt;</summary>
		<author><name>Fkaatje</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=Talk:Recursively_remove_empty_parent_directories&amp;diff=20752&amp;oldid=prev</id>
		<title>Fkaatje: Created page with &quot;This script will not work for empty parent directories directly under root (NSIS 2.46). Say your app is under C:\test\myapp. In your uninstall section you call:  RMDir &quot;$INSTDIR&quot;...&quot;</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Talk:Recursively_remove_empty_parent_directories&amp;diff=20752&amp;oldid=prev"/>
		<updated>2011-08-11T12:03:25Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;This script will not work for empty parent directories directly under root (NSIS 2.46). Say your app is under C:\test\myapp. In your uninstall section you call:  RMDir &amp;quot;$INSTDIR&amp;quot;...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This script will not work for empty parent directories directly under root (NSIS 2.46). Say your app is under C:\test\myapp. In your uninstall section you call:&lt;br /&gt;
&lt;br /&gt;
RMDir &amp;quot;$INSTDIR&amp;quot;&amp;lt;br/&amp;gt;&lt;br /&gt;
${RMDirUP} &amp;quot;$INSTDIR&amp;quot;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This does remove myapps and test (provided they are empty), but then gets into a loop when trying to remove C:\test\myapp\..\..&lt;br /&gt;
&lt;br /&gt;
RMDir on the root does not give an error and the script recursively continues with &lt;br /&gt;
&lt;br /&gt;
RMDir C:\test\myapp\..\..\..&amp;lt;br\&amp;gt;&lt;br /&gt;
RMDir C:\test\myapp\..\..\..\..&amp;lt;br\&amp;gt;&lt;br /&gt;
RMDir C:\test\myapp\..\..\..\..\..&amp;lt;br\&amp;gt;&lt;br /&gt;
etc.&lt;br /&gt;
&lt;br /&gt;
After some time the uninstaller exits and everything in your uninstall section after the RMDirUP call is not executed.&lt;br /&gt;
&lt;br /&gt;
I&amp;#039;m not sure if this is a flaw in the script or a bug in the RMDir instruction.&lt;br /&gt;
My proposal would be to change the function as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
!include &amp;quot;FileFunc.nsh&amp;quot;&lt;br /&gt;
&lt;br /&gt;
;--&lt;br /&gt;
;--&lt;br /&gt;
&lt;br /&gt;
Function un.RMDirUP&lt;br /&gt;
  !define RMDirUP &amp;#039;!insertmacro RMDirUPCall&amp;#039;&lt;br /&gt;
  !macro RMDirUPCall _PATH&lt;br /&gt;
    push &amp;#039;${_PATH}&amp;#039;&lt;br /&gt;
    Call un.RMDirUP&lt;br /&gt;
  !macroend&lt;br /&gt;
  ; $0 - current folder&lt;br /&gt;
  ClearErrors&lt;br /&gt;
  Exch $0&lt;br /&gt;
  ${GetParent} &amp;quot;$0&amp;quot; $R0&lt;br /&gt;
  ${GetRoot} &amp;quot;$0&amp;quot; $R1&lt;br /&gt;
  StrCmp $R0 $R1 Skip 0&lt;br /&gt;
  RMDir &amp;quot;$R0&amp;quot;&lt;br /&gt;
  IfErrors Skip&lt;br /&gt;
    ${RMDirUP} &amp;quot;$R0&amp;quot;&lt;br /&gt;
  Skip:&lt;br /&gt;
  Pop $0&lt;br /&gt;
FunctionEnd&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;/div&gt;</summary>
		<author><name>Fkaatje</name></author>
	</entry>
</feed>