[GRASS-SVN] r49506 - in grass/branches/develbranch_6: lib/init mswindows

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Dec 3 07:19:05 EST 2011


Author: martinl
Date: 2011-12-03 04:19:05 -0800 (Sat, 03 Dec 2011)
New Revision: 49506

Modified:
   grass/branches/develbranch_6/lib/init/init.bat
   grass/branches/develbranch_6/mswindows/GRASS-Installer.nsi
Log:
winGRASS: .grassrc6 -> C:\Users\landa\AppData\Roaming\GRASS6\grassrc6, don't remove existing conf file

Modified: grass/branches/develbranch_6/lib/init/init.bat
===================================================================
--- grass/branches/develbranch_6/lib/init/init.bat	2011-12-03 11:20:45 UTC (rev 49505)
+++ grass/branches/develbranch_6/lib/init/init.bat	2011-12-03 12:19:05 UTC (rev 49506)
@@ -14,7 +14,7 @@
 rem             and does not expect or provide an interactive terminal
 rem             running in addition to the GUI display.
 rem 
-rem  COPYRIGHT: (C) 2006 by the GRASS Development Team
+rem  COPYRIGHT: (C) 2006, 2011 by the GRASS Development Team
 rem
 rem             This program is free software under the GNU General Public
 rem   	    	License (>=v2). Read the file COPYING that comes with GRASS
@@ -25,13 +25,13 @@
 set SAVEPATH=%PATH%
 rem DON'T include scripts directory in PATH - .bat files in bin directory
 rem are used to run scripts on Windows
-if "%GRASS_ADDON_PATH%"=="" set PATH=%WINGISBASE%\bin;%WINGISBASE%\lib;%PATH%
+if "%GRASS_ADDON_PATH%"=="" set PATH=%WINGISBASE%\bin;%WINGISBASE%\lib;%APPDATA%\GRASS6\addons;%PATH%
 if not "%GRASS_ADDON_PATH%"=="" set PATH=%WINGISBASE%\bin;%WINGISBASE%\lib;%GRASS_ADDON_PATH%;%PATH%
 
 set GIS_LOCK=1
 set GRASS_VERSION=GRASS_VERSION_NUMBER
 if "%HOME%"=="" set HOME=%USERPROFILE%
-set WINGISRC=%HOME%\.grassrc6
+set WINGISRC=%APPDATA%\GRASS6\grassrc6
 rem Make sure %GISRC% is set so g.dirseps will work
 rem (not actually used)
 set GISRC=junk

Modified: grass/branches/develbranch_6/mswindows/GRASS-Installer.nsi
===================================================================
--- grass/branches/develbranch_6/mswindows/GRASS-Installer.nsi	2011-12-03 11:20:45 UTC (rev 49505)
+++ grass/branches/develbranch_6/mswindows/GRASS-Installer.nsi	2011-12-03 12:19:05 UTC (rev 49506)
@@ -789,18 +789,23 @@
 	;replace \ with / in $GIS_DATABASE
 	${StrReplace} "$UNIX_LIKE_GIS_DATABASE_PATH" "\" "/" "$GIS_DATABASE"
   
-	;create $PROFILE\.grassrc6
-	SetShellVarContext current
-	ClearErrors
-	FileOpen $0 $PROFILE\.grassrc6 w
-	IfErrors done_create_.grassrc6
-	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_.grassrc6:
+	SetShellVarContext current  
+	${If} ${FileExists} "$APPDATA\GRASS6\grassrc6"
+	      DetailPrint "File $APPDATA\GRASS6\grassrc6 already exists. Skipping."
+	${Else}
+	      ;create $APPDATA\GRASS6\grassrc6
+	      ClearErrors
+	      CreateDirectory	$APPDATA\GRASS6
+	      FileOpen $0 $APPDATA\GRASS6\grassrc6 w
+	      IfErrors done_create_grass6_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_grass6_rc:
+	${EndIf}
 	
-	CopyFiles $PROFILE\.grassrc6 $INSTALL_DIR\msys\home\$USERNAME
+	CopyFiles $APPDATA\GRASS6\grassrc6 $INSTALL_DIR\msys\home\$USERNAME\.grassrc6
                  
 SectionEnd
 
@@ -908,10 +913,14 @@
 	SetShellVarContext all
 	RMDir /r "$SMPROGRAMS\${GRASS_BASE}"
 	
-	;remove the .grassrc6 file
+	;remove the $APPDATA\GRASS6 folder
+	;disabled, don't remove user settings
 	SetShellVarContext current
-	Delete "$PROFILE\.grassrc6"	
-
+	;RMDir /r "$APPDATA\GRASS6"	
+	${If} ${FileExists} "$APPDATA\GRASS6\addons\*.*"
+	      RMDir /r "$APPDATA\GRASS6\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