Re-indent the whole file using Tabs for indentation.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3476 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
parent
c8690d4486
commit
b42da26f78
433
geany.nsi
433
geany.nsi
@ -117,196 +117,196 @@ InstType "Full"
|
|||||||
InstType "Minimal"
|
InstType "Minimal"
|
||||||
|
|
||||||
Section "!Program Files" SEC01
|
Section "!Program Files" SEC01
|
||||||
SectionIn RO 1 2
|
SectionIn RO 1 2
|
||||||
SetOverwrite ifnewer
|
SetOverwrite ifnewer
|
||||||
|
|
||||||
SetOutPath "$INSTDIR"
|
SetOutPath "$INSTDIR"
|
||||||
File "${RESOURCEDIR}\*.txt"
|
File "${RESOURCEDIR}\*.txt"
|
||||||
|
|
||||||
SetOutPath "$INSTDIR\bin"
|
SetOutPath "$INSTDIR\bin"
|
||||||
File "${RESOURCEDIR}\bin\Geany.exe"
|
File "${RESOURCEDIR}\bin\Geany.exe"
|
||||||
|
|
||||||
SetOutPath "$INSTDIR\data"
|
SetOutPath "$INSTDIR\data"
|
||||||
File "${RESOURCEDIR}\data\GPL-2"
|
File "${RESOURCEDIR}\data\GPL-2"
|
||||||
File "${RESOURCEDIR}\data\file*"
|
File "${RESOURCEDIR}\data\file*"
|
||||||
File "${RESOURCEDIR}\data\snippets.conf"
|
File "${RESOURCEDIR}\data\snippets.conf"
|
||||||
File "${RESOURCEDIR}\data\ui_toolbar.xml"
|
File "${RESOURCEDIR}\data\ui_toolbar.xml"
|
||||||
|
|
||||||
SetOutPath "$INSTDIR\share\icons"
|
SetOutPath "$INSTDIR\share\icons"
|
||||||
File /r "${RESOURCEDIR}\share\icons\*"
|
File /r "${RESOURCEDIR}\share\icons\*"
|
||||||
|
|
||||||
SetOutPath "$INSTDIR"
|
SetOutPath "$INSTDIR"
|
||||||
|
|
||||||
CreateShortCut "$INSTDIR\Geany.lnk" "$INSTDIR\bin\Geany.exe"
|
CreateShortCut "$INSTDIR\Geany.lnk" "$INSTDIR\bin\Geany.exe"
|
||||||
!insertmacro MUI_STARTMENU_WRITE_BEGIN ${PRODUCT_NAME}
|
!insertmacro MUI_STARTMENU_WRITE_BEGIN ${PRODUCT_NAME}
|
||||||
CreateDirectory "$SMPROGRAMS\$StartmenuFolder"
|
CreateDirectory "$SMPROGRAMS\$StartmenuFolder"
|
||||||
CreateShortCut "$SMPROGRAMS\$StartmenuFolder\Geany.lnk" "$INSTDIR\bin\Geany.exe"
|
CreateShortCut "$SMPROGRAMS\$StartmenuFolder\Geany.lnk" "$INSTDIR\bin\Geany.exe"
|
||||||
!insertmacro MUI_STARTMENU_WRITE_END
|
!insertmacro MUI_STARTMENU_WRITE_END
|
||||||
|
|
||||||
; register the extension .geany
|
; register the extension .geany
|
||||||
; write information about file type
|
; write information about file type
|
||||||
WriteRegStr SHCTX "Software\Classes\${PRODUCT_REGNAME}" "" "${PRODUCT_NAME} Project File"
|
WriteRegStr SHCTX "Software\Classes\${PRODUCT_REGNAME}" "" "${PRODUCT_NAME} Project File"
|
||||||
WriteRegStr SHCTX "Software\Classes\${PRODUCT_REGNAME}\DefaultIcon" "" "${PRODUCT_EXE},0"
|
WriteRegStr SHCTX "Software\Classes\${PRODUCT_REGNAME}\DefaultIcon" "" "${PRODUCT_EXE},0"
|
||||||
WriteRegStr SHCTX "Software\Classes\${PRODUCT_REGNAME}\Shell\open\command" "" '"${PRODUCT_EXE}" "%1"'
|
WriteRegStr SHCTX "Software\Classes\${PRODUCT_REGNAME}\Shell\open\command" "" '"${PRODUCT_EXE}" "%1"'
|
||||||
; write information about file extensions
|
; write information about file extensions
|
||||||
WriteRegStr SHCTX "Software\Classes\${PRODUCT_EXT}" "" "${PRODUCT_REGNAME}"
|
WriteRegStr SHCTX "Software\Classes\${PRODUCT_EXT}" "" "${PRODUCT_REGNAME}"
|
||||||
; refresh shell
|
; refresh shell
|
||||||
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) (0x08000000, 0, 0, 0)'
|
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) (0x08000000, 0, 0, 0)'
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
Section "Plugins" SEC02
|
Section "Plugins" SEC02
|
||||||
SectionIn 1
|
SectionIn 1
|
||||||
SetOverwrite ifnewer
|
SetOverwrite ifnewer
|
||||||
SetOutPath "$INSTDIR\lib"
|
SetOutPath "$INSTDIR\lib"
|
||||||
File "${RESOURCEDIR}\lib\*.dll"
|
File "${RESOURCEDIR}\lib\*.dll"
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
Section "Language Files" SEC03
|
Section "Language Files" SEC03
|
||||||
SectionIn 1
|
SectionIn 1
|
||||||
SetOutPath "$INSTDIR\share\locale"
|
SetOutPath "$INSTDIR\share\locale"
|
||||||
File /r "${RESOURCEDIR}\share\locale\*"
|
File /r "${RESOURCEDIR}\share\locale\*"
|
||||||
!ifdef INCLUDE_GTK
|
!ifdef INCLUDE_GTK
|
||||||
SetOutPath "$INSTDIR\share"
|
SetOutPath "$INSTDIR\share"
|
||||||
File /r "gtk\share\*"
|
File /r "gtk\share\*"
|
||||||
!endif
|
!endif
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
Section "Documentation" SEC04
|
Section "Documentation" SEC04
|
||||||
SectionIn 1
|
SectionIn 1
|
||||||
SetOverwrite ifnewer
|
SetOverwrite ifnewer
|
||||||
SetOutPath "$INSTDIR"
|
SetOutPath "$INSTDIR"
|
||||||
File /r "${RESOURCEDIR}\doc"
|
File /r "${RESOURCEDIR}\doc"
|
||||||
WriteIniStr "$INSTDIR\Documentation.url" "InternetShortcut" "URL" "$INSTDIR\doc\Manual.html"
|
WriteIniStr "$INSTDIR\Documentation.url" "InternetShortcut" "URL" "$INSTDIR\doc\Manual.html"
|
||||||
!insertmacro MUI_STARTMENU_WRITE_BEGIN ${PRODUCT_NAME}
|
!insertmacro MUI_STARTMENU_WRITE_BEGIN ${PRODUCT_NAME}
|
||||||
CreateShortCut "$SMPROGRAMS\$StartmenuFolder\Documentation.lnk" "$INSTDIR\Documentation.url"
|
CreateShortCut "$SMPROGRAMS\$StartmenuFolder\Documentation.lnk" "$INSTDIR\Documentation.url"
|
||||||
!insertmacro MUI_STARTMENU_WRITE_END
|
!insertmacro MUI_STARTMENU_WRITE_END
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
Section "Autocompletion Tags" SEC05
|
Section "Autocompletion Tags" SEC05
|
||||||
SectionIn 1
|
SectionIn 1
|
||||||
SetOutPath "$INSTDIR\data"
|
SetOutPath "$INSTDIR\data"
|
||||||
SetOverwrite ifnewer
|
SetOverwrite ifnewer
|
||||||
File "${RESOURCEDIR}\data\php.tags"
|
File "${RESOURCEDIR}\data\php.tags"
|
||||||
File "${RESOURCEDIR}\data\pascal.tags"
|
File "${RESOURCEDIR}\data\pascal.tags"
|
||||||
File "${RESOURCEDIR}\data\latex.tags"
|
File "${RESOURCEDIR}\data\latex.tags"
|
||||||
File "${RESOURCEDIR}\data\python.tags"
|
File "${RESOURCEDIR}\data\python.tags"
|
||||||
File "${RESOURCEDIR}\data\html_entities.tags"
|
File "${RESOURCEDIR}\data\html_entities.tags"
|
||||||
File "${RESOURCEDIR}\data\global.tags"
|
File "${RESOURCEDIR}\data\global.tags"
|
||||||
SectionEnd
|
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.14 Runtime Environment" SEC06
|
Section "GTK 2.14 Runtime Environment" SEC06
|
||||||
SectionIn 1
|
SectionIn 1
|
||||||
SetOverwrite ifnewer
|
SetOverwrite ifnewer
|
||||||
SetOutPath "$INSTDIR\bin"
|
SetOutPath "$INSTDIR\bin"
|
||||||
File /r "gtk\bin\*"
|
File /r "gtk\bin\*"
|
||||||
SetOutPath "$INSTDIR\etc"
|
SetOutPath "$INSTDIR\etc"
|
||||||
File /r "gtk\etc\*"
|
File /r "gtk\etc\*"
|
||||||
SetOutPath "$INSTDIR\lib"
|
SetOutPath "$INSTDIR\lib"
|
||||||
File /r "gtk\lib\*"
|
File /r "gtk\lib\*"
|
||||||
SectionEnd
|
SectionEnd
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
Section "Context Menus" SEC07
|
Section "Context Menus" SEC07
|
||||||
SectionIn 1
|
SectionIn 1
|
||||||
WriteRegStr HKCR "*\shell\OpenWithGeany" "" "Open with Geany"
|
WriteRegStr HKCR "*\shell\OpenWithGeany" "" "Open with Geany"
|
||||||
WriteRegStr HKCR "*\shell\OpenWithGeany\command" "" '$INSTDIR\bin\geany.exe "%1"'
|
WriteRegStr HKCR "*\shell\OpenWithGeany\command" "" '$INSTDIR\bin\geany.exe "%1"'
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
Section "Desktop Shortcuts" SEC08
|
Section "Desktop Shortcuts" SEC08
|
||||||
SectionIn 1
|
SectionIn 1
|
||||||
CreateShortCut "$DESKTOP\Geany.lnk" "$INSTDIR\bin\Geany.exe"
|
CreateShortCut "$DESKTOP\Geany.lnk" "$INSTDIR\bin\Geany.exe"
|
||||||
CreateShortCut "$QUICKLAUNCH\Geany.lnk" "$INSTDIR\bin\Geany.exe"
|
CreateShortCut "$QUICKLAUNCH\Geany.lnk" "$INSTDIR\bin\Geany.exe"
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
Section -AdditionalIcons
|
Section -AdditionalIcons
|
||||||
SetOutPath $INSTDIR
|
SetOutPath $INSTDIR
|
||||||
!insertmacro MUI_STARTMENU_WRITE_BEGIN ${PRODUCT_NAME}
|
!insertmacro MUI_STARTMENU_WRITE_BEGIN ${PRODUCT_NAME}
|
||||||
WriteIniStr "$INSTDIR\Website.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
|
WriteIniStr "$INSTDIR\Website.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
|
||||||
CreateShortCut "$SMPROGRAMS\$StartmenuFolder\Website.lnk" "$INSTDIR\Website.url"
|
CreateShortCut "$SMPROGRAMS\$StartmenuFolder\Website.lnk" "$INSTDIR\Website.url"
|
||||||
CreateShortCut "$SMPROGRAMS\$StartmenuFolder\Uninstall.lnk" "$INSTDIR\uninst.exe"
|
CreateShortCut "$SMPROGRAMS\$StartmenuFolder\Uninstall.lnk" "$INSTDIR\uninst.exe"
|
||||||
!insertmacro MUI_STARTMENU_WRITE_END
|
!insertmacro MUI_STARTMENU_WRITE_END
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
Section -Post
|
Section -Post
|
||||||
WriteUninstaller "$INSTDIR\uninst.exe"
|
WriteUninstaller "$INSTDIR\uninst.exe"
|
||||||
WriteRegStr SHCTX "${PRODUCT_DIR_REGKEY}" Path "$INSTDIR"
|
WriteRegStr SHCTX "${PRODUCT_DIR_REGKEY}" Path "$INSTDIR"
|
||||||
WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "StartMenu" "$SMPROGRAMS\$StartmenuFolder"
|
WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "StartMenu" "$SMPROGRAMS\$StartmenuFolder"
|
||||||
${if} $Answer == "yes" ; if user is admin
|
${if} $Answer == "yes" ; if user is admin
|
||||||
WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
|
WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
|
||||||
WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
|
WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
|
||||||
WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\bin\Geany.exe"
|
WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\bin\Geany.exe"
|
||||||
WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
|
WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
|
||||||
WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
|
WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
|
||||||
WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "URLUpdateInfo" "${PRODUCT_WEB_SITE}"
|
WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "URLUpdateInfo" "${PRODUCT_WEB_SITE}"
|
||||||
WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
|
WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
|
||||||
WriteRegDWORD SHCTX "${PRODUCT_UNINST_KEY}" "NoModify" 0x00000001
|
WriteRegDWORD SHCTX "${PRODUCT_UNINST_KEY}" "NoModify" 0x00000001
|
||||||
WriteRegDWORD SHCTX "${PRODUCT_UNINST_KEY}" "NoRepair" 0x00000001
|
WriteRegDWORD SHCTX "${PRODUCT_UNINST_KEY}" "NoRepair" 0x00000001
|
||||||
${endif}
|
${endif}
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
Section Uninstall
|
Section Uninstall
|
||||||
Delete "$INSTDIR\Website.url"
|
Delete "$INSTDIR\Website.url"
|
||||||
Delete "$INSTDIR\Documentation.url"
|
Delete "$INSTDIR\Documentation.url"
|
||||||
Delete "$INSTDIR\uninst.exe"
|
Delete "$INSTDIR\uninst.exe"
|
||||||
Delete "$INSTDIR\News.txt"
|
Delete "$INSTDIR\News.txt"
|
||||||
Delete "$INSTDIR\ReadMe.txt"
|
Delete "$INSTDIR\ReadMe.txt"
|
||||||
Delete "$INSTDIR\Thanks.txt"
|
Delete "$INSTDIR\Thanks.txt"
|
||||||
Delete "$INSTDIR\ToDo.txt"
|
Delete "$INSTDIR\ToDo.txt"
|
||||||
Delete "$INSTDIR\Authors.txt"
|
Delete "$INSTDIR\Authors.txt"
|
||||||
Delete "$INSTDIR\ChangeLog.txt"
|
Delete "$INSTDIR\ChangeLog.txt"
|
||||||
Delete "$INSTDIR\Copying.txt"
|
Delete "$INSTDIR\Copying.txt"
|
||||||
Delete "$INSTDIR\Geany.lnk"
|
Delete "$INSTDIR\Geany.lnk"
|
||||||
|
|
||||||
; delete start menu entry
|
; delete start menu entry
|
||||||
ReadRegStr $0 SHCTX "${PRODUCT_UNINST_KEY}" "StartMenu"
|
ReadRegStr $0 SHCTX "${PRODUCT_UNINST_KEY}" "StartMenu"
|
||||||
RMDir /r "$0"
|
RMDir /r "$0"
|
||||||
|
|
||||||
Delete "$QUICKLAUNCH\Geany.lnk"
|
Delete "$QUICKLAUNCH\Geany.lnk"
|
||||||
Delete "$DESKTOP\Geany.lnk"
|
Delete "$DESKTOP\Geany.lnk"
|
||||||
|
|
||||||
RMDir /r "$INSTDIR\bin"
|
RMDir /r "$INSTDIR\bin"
|
||||||
RMDir /r "$INSTDIR\doc"
|
RMDir /r "$INSTDIR\doc"
|
||||||
RMDir /r "$INSTDIR\data"
|
RMDir /r "$INSTDIR\data"
|
||||||
RMDir /r "$INSTDIR\etc"
|
RMDir /r "$INSTDIR\etc"
|
||||||
RMDir /r "$INSTDIR\lib"
|
RMDir /r "$INSTDIR\lib"
|
||||||
RMDir /r "$INSTDIR\share"
|
RMDir /r "$INSTDIR\share"
|
||||||
RMDir "$INSTDIR"
|
RMDir "$INSTDIR"
|
||||||
|
|
||||||
; remove .geany file extension
|
; remove .geany file extension
|
||||||
ReadRegStr $R0 SHCTX "Software\Classes\${PRODUCT_EXT}" ""
|
ReadRegStr $R0 SHCTX "Software\Classes\${PRODUCT_EXT}" ""
|
||||||
${if} $R0 == "${PRODUCT_REGNAME}"
|
${if} $R0 == "${PRODUCT_REGNAME}"
|
||||||
DeleteRegKey SHCTX "${PRODUCT_EXT}"
|
DeleteRegKey SHCTX "${PRODUCT_EXT}"
|
||||||
DeleteRegKey HKCR "${PRODUCT_EXT}"
|
DeleteRegKey HKCR "${PRODUCT_EXT}"
|
||||||
DeleteRegKey SHCTX "${PRODUCT_REGNAME}"
|
DeleteRegKey SHCTX "${PRODUCT_REGNAME}"
|
||||||
DeleteRegKey HKCR "${PRODUCT_REGNAME}"
|
DeleteRegKey HKCR "${PRODUCT_REGNAME}"
|
||||||
${endif}
|
${endif}
|
||||||
|
|
||||||
DeleteRegKey HKCR "*\shell\OpenWithGeany"
|
DeleteRegKey HKCR "*\shell\OpenWithGeany"
|
||||||
|
|
||||||
DeleteRegKey SHCTX "${PRODUCT_UNINST_KEY}"
|
DeleteRegKey SHCTX "${PRODUCT_UNINST_KEY}"
|
||||||
DeleteRegKey HKCU "${PRODUCT_UNINST_KEY}"
|
DeleteRegKey HKCU "${PRODUCT_UNINST_KEY}"
|
||||||
DeleteRegKey SHCTX "${PRODUCT_DIR_REGKEY}"
|
DeleteRegKey SHCTX "${PRODUCT_DIR_REGKEY}"
|
||||||
DeleteRegKey HKCU "${PRODUCT_DIR_REGKEY}"
|
DeleteRegKey HKCU "${PRODUCT_DIR_REGKEY}"
|
||||||
|
|
||||||
SetAutoClose true
|
SetAutoClose true
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
; Section descriptions ;
|
; Section descriptions ;
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
|
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
|
||||||
!insertmacro MUI_DESCRIPTION_TEXT ${SEC01} "Required program files. You cannot skip these files."
|
!insertmacro MUI_DESCRIPTION_TEXT ${SEC01} "Required program files. You cannot skip these files."
|
||||||
!insertmacro MUI_DESCRIPTION_TEXT ${SEC02} "Available plugins like 'Version Diff', 'Class Builder' and 'Insert Special Characters'."
|
!insertmacro MUI_DESCRIPTION_TEXT ${SEC02} "Available plugins like 'Version Diff', 'Class Builder' and 'Insert Special Characters'."
|
||||||
!insertmacro MUI_DESCRIPTION_TEXT ${SEC03} "Various translations of Geany's interface."
|
!insertmacro MUI_DESCRIPTION_TEXT ${SEC03} "Various translations of Geany's interface."
|
||||||
!insertmacro MUI_DESCRIPTION_TEXT ${SEC04} "Manual in Text and HTML format."
|
!insertmacro MUI_DESCRIPTION_TEXT ${SEC04} "Manual in Text and HTML format."
|
||||||
!insertmacro MUI_DESCRIPTION_TEXT ${SEC05} "Symbol lists necessary for auto completion of symbols."
|
!insertmacro MUI_DESCRIPTION_TEXT ${SEC05} "Symbol lists necessary for auto completion of symbols."
|
||||||
!ifdef INCLUDE_GTK
|
!ifdef INCLUDE_GTK
|
||||||
!insertmacro MUI_DESCRIPTION_TEXT ${SEC06} "You need this files to run Geany. If you have already installed a GTK Runtime Environment (2.6 or higher), you can skip it."
|
!insertmacro MUI_DESCRIPTION_TEXT ${SEC06} "You need this files to run Geany. If you have already installed a GTK Runtime Environment (2.6 or higher), you can skip it."
|
||||||
!endif
|
!endif
|
||||||
!insertmacro MUI_DESCRIPTION_TEXT ${SEC07} "Add context menu item 'Open With Geany'"
|
!insertmacro MUI_DESCRIPTION_TEXT ${SEC07} "Add context menu item 'Open With Geany'"
|
||||||
!insertmacro MUI_DESCRIPTION_TEXT ${SEC08} "Create shortcuts for Geany on the desktop and in the Quicklaunch Bar"
|
!insertmacro MUI_DESCRIPTION_TEXT ${SEC08} "Create shortcuts for Geany on the desktop and in the Quicklaunch Bar"
|
||||||
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;
|
||||||
@ -315,110 +315,111 @@ SectionEnd
|
|||||||
|
|
||||||
; (from http://jabref.svn.sourceforge.net/viewvc/jabref/trunk/jabref/src/windows/nsis/setup.nsi)
|
; (from http://jabref.svn.sourceforge.net/viewvc/jabref/trunk/jabref/src/windows/nsis/setup.nsi)
|
||||||
!macro IsUserAdmin Result UName
|
!macro IsUserAdmin Result UName
|
||||||
|
ClearErrors
|
||||||
|
UserInfo::GetName
|
||||||
|
IfErrors Win9x
|
||||||
|
Pop $0
|
||||||
|
StrCpy ${UName} $0
|
||||||
|
UserInfo::GetAccountType
|
||||||
|
Pop $1
|
||||||
|
${if} $1 == "Admin"
|
||||||
|
StrCpy ${Result} "yes"
|
||||||
|
${else}
|
||||||
|
StrCpy ${Result} "no"
|
||||||
|
${endif}
|
||||||
|
Goto done
|
||||||
|
|
||||||
ClearErrors
|
Win9x:
|
||||||
UserInfo::GetName
|
StrCpy ${Result} "yes"
|
||||||
IfErrors Win9x
|
done:
|
||||||
Pop $0
|
|
||||||
StrCpy ${UName} $0
|
|
||||||
UserInfo::GetAccountType
|
|
||||||
Pop $1
|
|
||||||
${if} $1 == "Admin"
|
|
||||||
StrCpy ${Result} "yes"
|
|
||||||
${else}
|
|
||||||
StrCpy ${Result} "no"
|
|
||||||
${endif}
|
|
||||||
Goto done
|
|
||||||
|
|
||||||
Win9x:
|
|
||||||
StrCpy ${Result} "yes"
|
|
||||||
done:
|
|
||||||
!macroend
|
!macroend
|
||||||
|
|
||||||
Function .onInit
|
Function .onInit
|
||||||
StrCpy "$StartmenuFolder" "Geany"
|
StrCpy "$StartmenuFolder" "Geany"
|
||||||
|
|
||||||
; (from http://jabref.svn.sourceforge.net/viewvc/jabref/trunk/jabref/src/windows/nsis/setup.nsi)
|
; (from http://jabref.svn.sourceforge.net/viewvc/jabref/trunk/jabref/src/windows/nsis/setup.nsi)
|
||||||
; If the user does *not* have administrator privileges, abort
|
; If the user does *not* have administrator privileges, abort
|
||||||
StrCpy $Answer ""
|
StrCpy $Answer ""
|
||||||
StrCpy $UserName ""
|
StrCpy $UserName ""
|
||||||
!insertmacro IsUserAdmin $Answer $UserName ; macro from LyXUtils.nsh
|
!insertmacro IsUserAdmin $Answer $UserName ; macro from LyXUtils.nsh
|
||||||
${if} $Answer == "yes"
|
${if} $Answer == "yes"
|
||||||
SetShellVarContext all ; set that e.g. shortcuts will be created for all users
|
SetShellVarContext all ; set that e.g. shortcuts will be created for all users
|
||||||
${else}
|
${else}
|
||||||
SetShellVarContext current
|
SetShellVarContext current
|
||||||
; TODO is this really what we want? $PROGRAMFILES is not much better because
|
; TODO is this really what we want? $PROGRAMFILES is not much better because
|
||||||
; probably the unprivileged user can't write it anyways
|
; probably the unprivileged user can't write it anyways
|
||||||
StrCpy $INSTDIR "$PROFILE\$(^Name)"
|
StrCpy $INSTDIR "$PROFILE\$(^Name)"
|
||||||
${endif}
|
${endif}
|
||||||
|
|
||||||
; prevent running multiple instances of the installer
|
; prevent running multiple instances of the installer
|
||||||
System::Call 'kernel32::CreateMutexA(i 0, i 0, t "geany_installer") i .r1 ?e'
|
System::Call 'kernel32::CreateMutexA(i 0, i 0, t "geany_installer") i .r1 ?e'
|
||||||
Pop $R0
|
Pop $R0
|
||||||
StrCmp $R0 0 +3
|
StrCmp $R0 0 +3
|
||||||
MessageBox MB_OK|MB_ICONEXCLAMATION "The installer is already running." /SD IDOK
|
MessageBox MB_OK|MB_ICONEXCLAMATION "The installer is already running." /SD IDOK
|
||||||
Abort
|
Abort
|
||||||
; warn about a new install over an existing installation
|
; warn about a new install over an existing installation
|
||||||
ReadRegStr $R0 SHCTX "${PRODUCT_UNINST_KEY}" "UninstallString"
|
ReadRegStr $R0 SHCTX "${PRODUCT_UNINST_KEY}" "UninstallString"
|
||||||
StrCmp $R0 "" finish
|
StrCmp $R0 "" finish
|
||||||
|
|
||||||
MessageBox MB_YESNO|MB_ICONEXCLAMATION \
|
MessageBox MB_YESNO|MB_ICONEXCLAMATION \
|
||||||
"Geany has already been installed. $\nDo you want to remove the previous version before installing $(^Name) ?" \
|
"Geany has already been installed. $\nDo you want to remove the previous version before installing $(^Name) ?" \
|
||||||
/SD IDYES IDYES remove IDNO finish
|
/SD IDYES IDYES remove IDNO finish
|
||||||
|
|
||||||
remove:
|
remove:
|
||||||
; run the uninstaller
|
; run the uninstaller
|
||||||
ClearErrors
|
ClearErrors
|
||||||
; we read the installation path of the old installation from the Registry
|
; we read the installation path of the old installation from the Registry
|
||||||
ReadRegStr $UNINSTDIR SHCTX "${PRODUCT_DIR_REGKEY}" "Path"
|
ReadRegStr $UNINSTDIR SHCTX "${PRODUCT_DIR_REGKEY}" "Path"
|
||||||
IfSilent dosilent nonsilent
|
IfSilent dosilent nonsilent
|
||||||
dosilent:
|
dosilent:
|
||||||
ExecWait '$R0 /S _?=$UNINSTDIR' ;Do not copy the uninstaller to a temp file
|
ExecWait '$R0 /S _?=$UNINSTDIR' ;Do not copy the uninstaller to a temp file
|
||||||
Goto finish
|
Goto finish
|
||||||
nonsilent:
|
nonsilent:
|
||||||
ExecWait '$R0 _?=$UNINSTDIR' ;Do not copy the uninstaller to a temp file
|
ExecWait '$R0 _?=$UNINSTDIR' ;Do not copy the uninstaller to a temp file
|
||||||
|
finish:
|
||||||
finish:
|
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
Function un.onUninstSuccess
|
Function un.onUninstSuccess
|
||||||
HideWindow
|
HideWindow
|
||||||
MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer." /SD IDOK
|
MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer." \
|
||||||
|
/SD IDOK
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
Function un.onInit
|
Function un.onInit
|
||||||
; If the user does *not* have administrator privileges, abort
|
; If the user does *not* have administrator privileges, abort
|
||||||
StrCpy $Answer ""
|
StrCpy $Answer ""
|
||||||
!insertmacro IsUserAdmin $Answer $UserName
|
!insertmacro IsUserAdmin $Answer $UserName
|
||||||
${if} $Answer == "yes"
|
${if} $Answer == "yes"
|
||||||
SetShellVarContext all
|
SetShellVarContext all
|
||||||
${else}
|
${else}
|
||||||
; check if the Geany has been installed with admin permisions
|
; check if the Geany has been installed with admin permisions
|
||||||
ReadRegStr $0 HKLM "${PRODUCT_UNINST_KEY}" "Publisher"
|
ReadRegStr $0 HKLM "${PRODUCT_UNINST_KEY}" "Publisher"
|
||||||
${if} $0 != ""
|
${if} $0 != ""
|
||||||
MessageBox MB_OK|MB_ICONSTOP "You need administrator privileges to uninstall Geany!" /SD IDOK
|
MessageBox MB_OK|MB_ICONSTOP "You need administrator privileges to uninstall Geany!" \
|
||||||
Abort
|
/SD IDOK
|
||||||
${endif}
|
Abort
|
||||||
SetShellVarContext current
|
${endif}
|
||||||
${endif}
|
SetShellVarContext current
|
||||||
|
${endif}
|
||||||
|
|
||||||
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" /SD IDYES IDYES +2
|
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" \
|
||||||
Abort
|
/SD IDYES IDYES +2
|
||||||
|
Abort
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
Function OnDirLeave
|
Function OnDirLeave
|
||||||
ClearErrors
|
ClearErrors
|
||||||
SetOutPath "$INSTDIR" ; what about IfError creating $INSTDIR?
|
SetOutPath "$INSTDIR" ; what about IfError creating $INSTDIR?
|
||||||
GetTempFileName $1 "$INSTDIR" ; creates tmp file (or fails)
|
GetTempFileName $1 "$INSTDIR" ; creates tmp file (or fails)
|
||||||
FileOpen $0 "$1" "w" ; error to open?
|
FileOpen $0 "$1" "w" ; error to open?
|
||||||
FileWriteByte $0 "0"
|
FileWriteByte $0 "0"
|
||||||
IfErrors notPossible possible
|
IfErrors notPossible possible
|
||||||
|
|
||||||
notPossible:
|
notPossible:
|
||||||
RMDir "$INSTDIR" ; removes folder if empty
|
RMDir "$INSTDIR" ; removes folder if empty
|
||||||
MessageBox MB_OK "The given directory is not writeable. Please choose another one!" /SD IDOK
|
MessageBox MB_OK "The given directory is not writeable. Please choose another one!" /SD IDOK
|
||||||
Abort
|
Abort
|
||||||
possible:
|
possible:
|
||||||
FileClose $0
|
FileClose $0
|
||||||
Delete "$1"
|
Delete "$1"
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
Loading…
x
Reference in New Issue
Block a user