1 ;NSIS Modern User Interface
2 ;Start Menu Folder Selection Example Script
3 ;Written by Joost Verburg
5 ;--------------------------------
10 ;--------------------------------
16 SetCompressor /SOLID lzma
18 ;Default installation folder
19 InstallDir "$PROGRAMFILES\Yoink"
21 ;Get installation folder from registry if available
22 InstallDirRegKey HKCU "Software\Yoink" ""
24 ;Request application privileges for Windows Vista
25 RequestExecutionLevel user
27 ;--------------------------------
30 !define MUI_ICON "${ROOTPATH}/arch/win32/setup.ico"
31 !define MUI_UNICON "${ROOTPATH}/arch/win32/uninstall.ico"
33 !define MUI_COMPONENTSPAGE_SMALLDESC
35 !define MUI_FINISHPAGE_RUN "$INSTDIR\yoink.exe"
36 !define MUI_FINISHPAGE_RUN_NOTCHECKED
37 !define MUI_FINISHPAGE_LINK "Visit the Yoink website"
38 !define MUI_FINISHPAGE_LINK_LOCATION "http://www.dogcows.com/"
40 !define MUI_ABORTWARNING
42 ;--------------------------------
45 !insertmacro MUI_PAGE_WELCOME
46 !insertmacro MUI_PAGE_COMPONENTS
47 !insertmacro MUI_PAGE_DIRECTORY
48 !insertmacro MUI_PAGE_INSTFILES
49 !insertmacro MUI_PAGE_FINISH
51 !insertmacro MUI_UNPAGE_CONFIRM
52 !insertmacro MUI_UNPAGE_INSTFILES
54 ;--------------------------------
57 !insertmacro MUI_LANGUAGE "English"
59 ;--------------------------------
62 Section "Install Yoink!" SecInstallYoink
66 ;ADD YOUR OWN FILES HERE...
67 File /r "${INSTALLFILES}/*"
69 ;Store installation folder
70 WriteRegStr HKCU "Software\Yoink" "" $INSTDIR
73 WriteUninstaller "uninstall.exe"
76 CreateDirectory "$SMPROGRAMS\Yoink"
77 CreateShortCut "$SMPROGRAMS\Yoink\Play Yoink!.lnk" "$INSTDIR\yoink.exe"
78 CreateShortCut "$SMPROGRAMS\Yoink\Uninstall.lnk" "$INSTDIR\uninstall.exe"
80 WriteRegStr HKCU "Software\Games\Yoink" "" "$INSTDIR"
81 WriteRegStr HKCU "Software\Games\Yoink" "Version" "${VERSION}"
82 WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Yoink" "DisplayName" "Yoink"
83 WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Yoink" "DisplayVersion" "${VERSION}"
84 WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Yoink" "UninstallString" "$INSTDIR\uninstall.exe"
88 Section "Install desktop shortcut." SecInstallShortcut
92 CreateShortCut "$DESKTOP\Yoink.lnk" "$INSTDIR\yoink.exe"
97 ;--------------------------------
101 LangString DESC_SecInstallYoink ${LANG_ENGLISH} "Install the game executable and data files."
102 LangString DESC_SecInstallShortcut ${LANG_ENGLISH} "Install a shortcut to the executable on the desktop."
104 ;Assign language strings to sections
105 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
106 !insertmacro MUI_DESCRIPTION_TEXT ${SecInstallYoink} $(DESC_SecInstallYoink)
107 !insertmacro MUI_DESCRIPTION_TEXT ${SecInstallShortcut} $(DESC_SecInstallShortcut)
108 !insertmacro MUI_FUNCTION_DESCRIPTION_END
110 ;--------------------------------
115 Delete "$SMPROGRAMS\Yoink\*.*"
116 RMDir "$SMPROGRAMS\Yoink"
117 Delete "$DESKTOP\Yoink.lnk"
119 DeleteRegKey /ifempty HKCU "Software\Games\Yoink"
120 DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Yoink"
126 ;--------------------------------
131 ;Run the uninstaller if Yoink is already installed.
132 ReadRegStr $R0 HKCU \
133 "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Yoink" \
137 MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
138 "Yoink is already installed. $\n$\nClick `OK` to remove the \
139 previous version or `Cancel` to cancel the installation." \
146 ExecWait $INSTDIR\uninstall.exe