[GRASS-SVN] r42332 - grass/trunk/mswindows

svn_grass at osgeo.org svn_grass at osgeo.org
Sun May 23 17:04:15 EDT 2010


Author: hellik
Date: 2010-05-23 17:04:14 -0400 (Sun, 23 May 2010)
New Revision: 42332

Modified:
   grass/trunk/mswindows/GRASS-Installer.nsi
Log:
reflect $INSTDIR in grass70.py for starting the WinGrass70-installation

Modified: grass/trunk/mswindows/GRASS-Installer.nsi
===================================================================
--- grass/trunk/mswindows/GRASS-Installer.nsi	2010-05-21 15:26:06 UTC (rev 42331)
+++ grass/trunk/mswindows/GRASS-Installer.nsi	2010-05-23 21:04:14 UTC (rev 42332)
@@ -320,8 +320,73 @@
 ;	
 ;FunctionEnd
 
+;ReplaceLineString Function
+;Replace String in an existing file
+
 ;----------------------------------------------------------------------------------------------------------------------------
+; code taken from http://nsis.sourceforge.net/Replace_line_that_starts_with_specified_string
 
+Function ReplaceLineStr
+ Exch $R0 ; string to replace that whole line with
+ Exch
+ Exch $R1 ; string that line should start with
+ Exch
+ Exch 2
+ Exch $R2 ; file
+ Push $R3 ; file handle
+ Push $R4 ; temp file
+ Push $R5 ; temp file handle
+ Push $R6 ; global
+ Push $R7 ; input string length
+ Push $R8 ; line string length
+ Push $R9 ; global
+ 
+  StrLen $R7 $R1
+ 
+  GetTempFileName $R4
+ 
+  FileOpen $R5 $R4 w
+  FileOpen $R3 $R2 r
+ 
+  ReadLoop:
+  ClearErrors
+   FileRead $R3 $R6
+    IfErrors Done
+ 
+   StrLen $R8 $R6
+   StrCpy $R9 $R6 $R7 -$R8
+   StrCmp $R9 $R1 0 +3
+ 
+    FileWrite $R5 "$R0$\r$\n"
+    Goto ReadLoop
+ 
+    FileWrite $R5 $R6
+    Goto ReadLoop
+ 
+  Done:
+ 
+  FileClose $R3
+  FileClose $R5
+ 
+  SetDetailsPrint none
+   Delete $R2
+   Rename $R4 $R2
+  SetDetailsPrint both
+ 
+ Pop $R9
+ Pop $R8
+ Pop $R7
+ Pop $R6
+ Pop $R5
+ Pop $R4
+ Pop $R3
+ Pop $R2
+ Pop $R1
+ Pop $R0
+FunctionEnd
+
+;----------------------------------------------------------------------------------------------------------------------------
+
 ;Interface Settings
 
 !define MUI_ABORTWARNING
@@ -761,6 +826,18 @@
 	
 	CreateDirectory	$INSTALL_DIR\msys\home\$USERNAME\.grass7
 	CopyFiles $PROFILE\.grass7\rc $INSTALL_DIR\msys\home\$USERNAME\.grass7
+	
+		;replace gisbase = "/c/OSGeo4W/apps/grass/grass-7.0.svn" in grass70.py with $INSTDIR
+	 Push "$INSTDIR\grass70.py" ; file to modify
+	 Push 'gisbase = "/c/OSGeo4W/apps/grass/grass-7.0.svn"' ; string that a line must begin with *WS Sensitive*
+	 Push 'gisbase = "$INSTDIR"' ; string to replace whole line with
+	Call ReplaceLineStr
+	
+	;replace config_projshare = "/c/OSGeo4W/share/proj" i n grass70.py with $INSTDIR\proj
+	Push "$INSTDIR\grass70.py" ; file to modify
+	Push 'config_projshare = "/c/OSGeo4W/share/proj"' ; string that a line must begin with *WS Sensitive*
+	Push 'gisbase = "$INSTDIR\proj"' ; string to replace whole line with
+	Call ReplaceLineStr
                  
 SectionEnd
 



More information about the grass-commit mailing list