浏览代码

various minor fixes in winGRASS installer

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@41745 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 15 年之前
父节点
当前提交
5ee9127fe3
共有 2 个文件被更改,包括 9 次插入7 次删除
  1. 4 1
      lib/init/grass.py
  2. 5 6
      mswindows/GRASS-Installer.nsi

+ 4 - 1
lib/init/grass.py

@@ -39,7 +39,10 @@ else:
 cmd_name = "@START_UP@"
 cmd_name = "@START_UP@"
 grass_version = "@GRASS_VERSION_NUMBER@"
 grass_version = "@GRASS_VERSION_NUMBER@"
 ld_library_path_var = '@LD_LIBRARY_PATH_VAR@'
 ld_library_path_var = '@LD_LIBRARY_PATH_VAR@'
-config_projshare = "@CONFIG_PROJSHARE@"
+if os.getenv("GRASS_PROJSHARE"):
+    config_projshare = os.getenv("GRASS_PROJSHARE")
+else:
+    config_projshare = "@CONFIG_PROJSHARE@"
 grass_config_dirname = "@GRASS_CONFIG_DIR@"
 grass_config_dirname = "@GRASS_CONFIG_DIR@"
 
 
 gisbase = os.path.normpath(gisbase)
 gisbase = os.path.normpath(gisbase)

+ 5 - 6
mswindows/GRASS-Installer.nsi

@@ -728,10 +728,7 @@ Section "GRASS" SecGRASS
 	FileWrite $0 '"$$GRASS_PYTHON $$GISBASE/grass70.py" "$$@"'
 	FileWrite $0 '"$$GRASS_PYTHON $$GISBASE/grass70.py" "$$@"'
 	FileClose $0
 	FileClose $0
 	done_create_grass_command:
 	done_create_grass_command:
-
-	;Create the $INSTALL_DIR\msys\grass link directory
-	CreateDirectory $INSTALL_DIR\msys\grass
-	
+		
 	;Get the short form of the install path (to allow for paths with spaces)
 	;Get the short form of the install path (to allow for paths with spaces)
 	VAR /GLOBAL INST_DIR_SHORT
 	VAR /GLOBAL INST_DIR_SHORT
 	GetFullPathName /SHORT $INST_DIR_SHORT $INSTALL_DIR
 	GetFullPathName /SHORT $INST_DIR_SHORT $INSTALL_DIR
@@ -753,6 +750,7 @@ Section "GRASS" SecGRASS
 	;create $PROFILE\.grass7\rc
 	;create $PROFILE\.grass7\rc
 	SetShellVarContext current
 	SetShellVarContext current
 	ClearErrors
 	ClearErrors
+	CreateDirectory	$PROFILE\.grass7
 	FileOpen $0 $PROFILE\.grass7\rc w
 	FileOpen $0 $PROFILE\.grass7\rc w
 	IfErrors done_create_.grass7\rc
 	IfErrors done_create_.grass7\rc
 	FileWrite $0 'GISDBASE: $UNIX_LIKE_GIS_DATABASE_PATH$\r$\n'
 	FileWrite $0 'GISDBASE: $UNIX_LIKE_GIS_DATABASE_PATH$\r$\n'
@@ -761,7 +759,8 @@ Section "GRASS" SecGRASS
 	FileClose $0	
 	FileClose $0	
 	done_create_.grass7\rc:
 	done_create_.grass7\rc:
 	
 	
-	CopyFiles $PROFILE\.grass7\rc $INSTALL_DIR\msys\home\$USERNAME
+	CreateDirectory	$INSTALL_DIR\msys\home\$USERNAME\.grass7
+	CopyFiles $PROFILE\.grass7\rc $INSTALL_DIR\msys\home\$USERNAME\.grass7
                  
                  
 SectionEnd
 SectionEnd
 
 
@@ -908,7 +907,7 @@ Section "Uninstall"
 	
 	
 	;remove the .grass7\rc file
 	;remove the .grass7\rc file
 	SetShellVarContext current
 	SetShellVarContext current
-	Delete "$PROFILE\.grass7\rc"	
+	RMDir /r "$PROFILE\.grass7"
 
 
 	;remove the Registry Entries
 	;remove the Registry Entries
 	DeleteRegKey HKLM "Software\${GRASS_BASE}"
 	DeleteRegKey HKLM "Software\${GRASS_BASE}"