Prevent installation in a directory without proper write permissions under Windows. Display an error message instead.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1513 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
parent
7821bde1d2
commit
c9d5ef64c1
@ -1,6 +1,9 @@
|
|||||||
2007-05-07 Enrico Tröger <enrico.troeger@uvena.de>
|
2007-05-07 Enrico Tröger <enrico.troeger@uvena.de>
|
||||||
|
|
||||||
* data/filetypes.haskell: Added build instructions.
|
* data/filetypes.haskell: Added build instructions.
|
||||||
|
* geany.nsi: Prevent installation in a directory without proper
|
||||||
|
write permissions under Windows.
|
||||||
|
Display an error message instead.
|
||||||
|
|
||||||
|
|
||||||
2007-05-06 Enrico Tröger <enrico.troeger@uvena.de>
|
2007-05-06 Enrico Tröger <enrico.troeger@uvena.de>
|
||||||
|
|||||||
24
geany.nsi
24
geany.nsi
@ -20,7 +20,7 @@
|
|||||||
!define RESOURCEDIR "geany-${PRODUCT_VERSION}"
|
!define RESOURCEDIR "geany-${PRODUCT_VERSION}"
|
||||||
|
|
||||||
; only used when embedding GTK+ installer
|
; only used when embedding GTK+ installer
|
||||||
!define GTK_INSTALLER "gtk+-2.8.18-setup-1.exe"
|
!define GTK_INSTALLER "gtk+-2.10.6-1-setup.exe"
|
||||||
|
|
||||||
SetCompressor /SOLID lzma
|
SetCompressor /SOLID lzma
|
||||||
XPStyle on
|
XPStyle on
|
||||||
@ -89,6 +89,7 @@ FunctionEnd
|
|||||||
; Components page
|
; Components page
|
||||||
!insertmacro MUI_PAGE_COMPONENTS
|
!insertmacro MUI_PAGE_COMPONENTS
|
||||||
; Directory page
|
; Directory page
|
||||||
|
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE OnDirLeave
|
||||||
!insertmacro MUI_PAGE_DIRECTORY
|
!insertmacro MUI_PAGE_DIRECTORY
|
||||||
; Start menu page
|
; Start menu page
|
||||||
var ICONS_GROUP
|
var ICONS_GROUP
|
||||||
@ -145,7 +146,7 @@ SectionEnd
|
|||||||
|
|
||||||
Section "Documentation" SEC03
|
Section "Documentation" SEC03
|
||||||
SectionIn 1
|
SectionIn 1
|
||||||
SetOverwrite try
|
SetOverwrite ifnewer
|
||||||
SetOutPath "$INSTDIR"
|
SetOutPath "$INSTDIR"
|
||||||
File /r "${RESOURCEDIR}\doc"
|
File /r "${RESOURCEDIR}\doc"
|
||||||
|
|
||||||
@ -169,7 +170,7 @@ SectionEnd
|
|||||||
|
|
||||||
; Include GTK runtime library but only if desired from command line
|
; Include GTK runtime library but only if desired from command line
|
||||||
!ifdef INCLUDE_GTK
|
!ifdef INCLUDE_GTK
|
||||||
Section "GTK 2.8 Runtime Environment" SEC05
|
Section "GTK 2.10 Runtime Environment" SEC05
|
||||||
SectionIn 1
|
SectionIn 1
|
||||||
SetOutPath "$INSTDIR"
|
SetOutPath "$INSTDIR"
|
||||||
SetOverwrite ifnewer
|
SetOverwrite ifnewer
|
||||||
@ -243,6 +244,23 @@ Function un.onInit
|
|||||||
Abort
|
Abort
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
|
Function OnDirLeave
|
||||||
|
ClearErrors
|
||||||
|
SetOutPath "$INSTDIR" ; what about IfError creating $INSTDIR?
|
||||||
|
GetTempFileName $1 "$INSTDIR" ; creates tmp file (or fails)
|
||||||
|
FileOpen $0 "$1" "w" ; error to open?
|
||||||
|
FileWriteByte $0 "0"
|
||||||
|
IfErrors notPossible possible
|
||||||
|
|
||||||
|
notPossible:
|
||||||
|
RMDir "$INSTDIR" ; removes folder if empty
|
||||||
|
MessageBox MB_OK "The given directory is not writeable. Please choose another one!"
|
||||||
|
Abort
|
||||||
|
possible:
|
||||||
|
FileClose $0
|
||||||
|
Delete "$1"
|
||||||
|
FunctionEnd
|
||||||
|
|
||||||
Section Uninstall
|
Section Uninstall
|
||||||
!insertmacro MUI_STARTMENU_GETFOLDER "Application" $ICONS_GROUP
|
!insertmacro MUI_STARTMENU_GETFOLDER "Application" $ICONS_GROUP
|
||||||
Delete "$INSTDIR\${PRODUCT_NAME}.url"
|
Delete "$INSTDIR\${PRODUCT_NAME}.url"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user