Author: peterw
Date: Sun Nov 25 22:44:22 2007
New Revision: 30751
URL:
http://svn.reactos.org/svn/reactos?rev=30751&view=rev
Log:
- Fix the uninstall previous routine.
Modified:
trunk/tools/RosBE/RosBE-Windows/RosBE.nsi
Modified: trunk/tools/RosBE/RosBE-Windows/RosBE.nsi
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/RosBE.ns…
==============================================================================
--- trunk/tools/RosBE/RosBE-Windows/RosBE.nsi (original)
+++ trunk/tools/RosBE/RosBE-Windows/RosBE.nsi Sun Nov 25 22:44:22 2007
@@ -366,5 +366,34 @@
UninstallPrevious_no:
Quit
UninstallPrevious_yes:
- ExecWait '$R0 _?=$INSTDIR'
-FunctionEnd
+ Var /global PREVIOUSINSTDIR
+ Push $R0
+ Call GetParent
+ Pop $PREVIOUSINSTDIR
+ ExecWait '$R0 _?=$PREVIOUSINSTDIR'
+FunctionEnd
+
+Function GetParent
+ Exch $R0
+ Push $R1
+ Push $R2
+ Push $R3
+
+ StrCpy $R1 0
+ StrLen $R2 $R0
+
+ loop:
+ IntOp $R1 $R1 + 1
+ IntCmp $R1 $R2 get 0 get
+ StrCpy $R3 $R0 1 -$R1
+ StrCmp $R3 "\" get
+ Goto loop
+
+ get:
+ StrCpy $R0 $R0 -$R1
+
+ Pop $R3
+ Pop $R2
+ Pop $R1
+ Exch $R0
+FunctionEnd