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

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Dec 2 11:20:47 EST 2011


Author: martinl
Date: 2011-12-02 08:20:46 -0800 (Fri, 02 Dec 2011)
New Revision: 49490

Modified:
   grass/trunk/mswindows/GRASS-Installer.nsi
Log:
winGRASS standalone installer: don't overwrite GISRC if exists

Modified: grass/trunk/mswindows/GRASS-Installer.nsi
===================================================================
--- grass/trunk/mswindows/GRASS-Installer.nsi	2011-12-02 12:41:21 UTC (rev 49489)
+++ grass/trunk/mswindows/GRASS-Installer.nsi	2011-12-02 16:20:46 UTC (rev 49490)
@@ -868,19 +868,23 @@
   
 	;replace \ with / in $GIS_DATABASE
 	${StrReplace} "$UNIX_LIKE_GIS_DATABASE_PATH" "\" "/" "$GIS_DATABASE"
-  
-	;create $APPDATA\GRASS7\rc
-	SetShellVarContext current
-	ClearErrors
-	CreateDirectory	$APPDATA\GRASS7
-	FileOpen $0 $APPDATA\GRASS7\rc w
-	IfErrors done_create_grass7\rc
-	FileWrite $0 'GISDBASE: $UNIX_LIKE_GIS_DATABASE_PATH$\r$\n'
-	FileWrite $0 'LOCATION_NAME: demolocation$\r$\n'
-	FileWrite $0 'MAPSET: PERMANENT$\r$\n'
-	FileClose $0	
-	done_create_grass7\rc:
-	
+
+	SetShellVarContext current  
+	${If} ${FileExists} "$APPDATA\GRASS7\rc"
+	      DetailPrint "File $APPDATA\GRASS7\rc already exists. Skipping."
+	${Else}
+	      ;create $APPDATA\GRASS7\rc
+	      ClearErrors
+	      CreateDirectory	$APPDATA\GRASS7
+	      FileOpen $0 $APPDATA\GRASS7\rc w
+	      IfErrors done_create_grass7_rc
+	      FileWrite $0 'GISDBASE: $UNIX_LIKE_GIS_DATABASE_PATH$\r$\n'
+	      FileWrite $0 'LOCATION_NAME: demolocation$\r$\n'
+	      FileWrite $0 'MAPSET: PERMANENT$\r$\n'
+	      FileClose $0	
+	      done_create_grass7_rc:
+	${EndIf}
+
 	;replace gisbase = "/c/OSGeo4W/apps/grass/grass-7.0.svn" in grass70.py with $INSTDIR
 	Push "$INSTDIR\etc\grass70.py" ; file to modify
 	Push 'gisbase = "/c/OSGeo4W/apps/grass/grass-7.0.svn"' ; string that a line must begin with *WS Sensitive*
@@ -1001,9 +1005,12 @@
 	
 	;remove the $APPDATA\GRASS7 folder
 	;disabled, don't remove user settings
-	;SetShellVarContext current
-	;RMDir /r "$APPDATA\GRASS7"
-
+	SetShellVarContext current
+	;RMDir /r "$APPDATA\GRASS7"	
+	${If} ${FileExists} "$APPDATA\GRASS7\addons\*.*"
+	      RMDir /r "$APPDATA\GRASS7\addons"
+	${EndIf}
+	
 	;remove the Registry Entries
 	DeleteRegKey HKLM "Software\${GRASS_BASE}"
 	DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${GRASS_BASE}"



More information about the grass-commit mailing list