pygame is sharing code with you
Bitbucket is a code hosting site. Unlimited public and private repositories. Free for small teams.
Don't show this againpygame / pygame-docs.nsi
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | # NSIS Install script for Pygame Documents and Examples.
# NSIS (Nullsoft Scriptable Install System) can be downloaded at
# <http://nsis.sourceforge.net/Main_Page>.
# Information is take from header pygame-docs.nsh, which
# contains the constants APP_VERSION, SOURCE_DIRECTORY.
!include "MUI2.nsh"
!include "pygame-docs.nsh"
!define APP_NAME "Pygame ${APP_VERSION} Documents and Examples"
!define SHORT_APP_NAME "pygame-${APP_VERSION}-docs"
!define INSTDIR_REG_ROOT "HKLM"
!define INSTDIR_REG_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${SHORT_APP_NAME}"
!include "AdvUninstLog.nsh"
Name "${APP_NAME}"
OutFile "${SHORT_APP_NAME}-setup.exe"
InstallDir "$PROGRAMFILES\${APP_NAME}"
ShowInstDetails show
ShowUninstDetails show
InstallDirRegKey ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}" "InstallDir"
RequestExecutionLevel admin ; For Vista, because alters registry.
Var StartMenuFolder
Var InstalledSomething
;!insertmacro UNATTENDED_UNINSTALL
!insertmacro INTERACTIVE_UNINSTALL
!define MUI_WELCOMEPAGE_TITLE "${APP_NAME}"
!define MUI_WELCOMEPAGE_TEXT \
"This will install the Pygame ${APP_VERSION} HTML documents and tutorials and the example programs."
!define MUI_WELCOMEFINISHPAGE_BITMAP "welcome.bmp"
!insertmacro MUI_PAGE_WELCOME
!define MUI_COMPONENTSPAGE_NODESC
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_STARTMENU "ProgramFolder" $StartMenuFolder
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
!insertmacro MUI_LANGUAGE "English"
Section "HTML Documents and Tutorials"
SetOutPath '$INSTDIR'
!insertmacro UNINSTALL.LOG_OPEN_INSTALL
File /r /x .svn /x *.*~ "${SOURCE_DIRECTORY}\docs"
File "${SOURCE_DIRECTORY}\readme.html"
File "${SOURCE_DIRECTORY}\install.html"
File "${SOURCE_DIRECTORY}\LGPL"
!insertmacro UNINSTALL.LOG_CLOSE_INSTALL
StrCpy $InstalledSomething 'true'
SectionEnd
Section "Example Programs"
SetOutPath '$INSTDIR'
!insertmacro UNINSTALL.LOG_OPEN_INSTALL
File /r /x .svn /x *.*~ /x *.pyc "${SOURCE_DIRECTORY}\examples"
!insertmacro UNINSTALL.LOG_CLOSE_INSTALL
StrCpy $InstalledSomething 'true'
SectionEnd
Function .onInit
!insertmacro UNINSTALL.LOG_PREPARE_INSTALL
FunctionEnd
Function .onInstSuccess
Push $0
Push $1
StrCmp $InstalledSomething 'true' +1 InstallationEnd
!insertmacro MUI_STARTMENU_WRITE_BEGIN ProgramFolder
StrCpy $1 "$SMPROGRAMS\$StartMenuFolder"
WriteRegStr ${INSTDIR_REG_ROOT} ${INSTDIR_REG_KEY} 'StartMenuPath' "$1"
CreateDirectory "$1"
StrCpy $0 "$INSTDIR\docs\index.html"
IfFileExists "$0" +1 +2
CreateShortcut "$1\Documents.lnk" "$0"
StrCpy $0 "$INSTDIR\examples"
IfFileExists "$0" +1 +2
CreateShortCut "$1\Examples.lnk" "$0"
CreateShortCut "$1\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
!insertmacro MUI_STARTMENU_WRITE_END
WriteRegStr ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}" "InstallDir" "$INSTDIR"
WriteRegStr ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}" "DisplayName" "${APP_NAME}"
WriteRegStr ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}" "UninstallString" "${UNINST_EXE}"
InstallationEnd:
!insertmacro UNINSTALL.LOG_UPDATE_INSTALL
Pop $1
Pop $0
FunctionEnd
Section UnInstall
push $0
!insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR"
!insertmacro UNINSTALL.LOG_UNINSTALL "$APPDATA\${APP_NAME}"
!insertmacro UNINSTALL.LOG_END_UNINSTALL
ReadRegStr $0 ${INSTDIR_REG_ROOT} ${INSTDIR_REG_KEY} 'StartMenuPath'
IfErrors StartMenuEnd
Delete "$0\Documents.lnk"
Delete "$0\Examples.lnk"
Delete "$0\Uninstall.lnk"
RMDir "$0"
DeleteRegValue ${INSTDIR_REG_ROOT} ${INSTDIR_REG_KEY} 'StartMenuPath'
StartMenuEnd:
ClearErrors
DeleteRegKey /ifempty ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}"
pop $0
SectionEnd
Function UN.onInit
!insertmacro UNINSTALL.LOG_BEGIN_UNINSTALL
StrCpy $InstalledSomething 'false'
FunctionEnd
|