Save ROM name hints
[lsnes.git] / lsnes.nsi
blobb8c88a64f3629f44c3e4b74f4fc6a35920094166
1 !define PRODUCT_NAME "lsnes"
2 !define PRODUCT_VERSION "rr1-delta18"
3 !define PRODUCT_PUBLISHER "Ilari"
4 !define PRODUCT_WEB_SITE "http://tasvideos.org/Lsnes.html"
5 !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
6 !define PRODUCT_UNINST_ROOT_KEY "HKLM"
8 !define INSTALL_DIR "lsnes"
10 SetCompressor /SOLID lzma
11 BrandingText "${PRODUCT_NAME} ${PRODUCT_VERSION} Installer"
12 Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
13 OutFile "${PRODUCT_NAME}-${PRODUCT_VERSION}-installer.exe"
14 InstallDir "$PROGRAMFILES\${INSTALL_DIR}"
15 InstallDirRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DIR"
16 ShowInstDetails show
17 ShowUnInstDetails show
18 RequestExecutionLevel admin ;Request elevated privileges for Windows 6.x+
20 ; MUI 1.67 compatible ------
21 !include "MUI.nsh"
23 ; MUI Settings
24 !define MUI_ABORTWARNING
25 !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
26 !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
28 ; License page
29 !define MUI_LICENSEPAGE_CHECKBOX
30 !insertmacro MUI_PAGE_LICENSE "COPYING.GPL"
31 !define MUI_LICENSEPAGE_CHECKBOX
32 !insertmacro MUI_PAGE_LICENSE "COPYING.GPL3"
33 ;Directory page
34 !insertmacro MUI_PAGE_DIRECTORY
35 ; Instfiles page
36 !insertmacro MUI_PAGE_INSTFILES
37 ; Finish page
38 !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\manual.txt"
39 !insertmacro MUI_PAGE_FINISH
41 ; Uninstaller pages
42 !insertmacro MUI_UNPAGE_INSTFILES
43 ; Language files
44 !insertmacro MUI_LANGUAGE "English"
45 ; Reserve files
46 !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
48 ; MUI end ------
50 Section "Main installer files" SEC01
51 SetShellVarContext all
53 SetOutPath "$INSTDIR"
54 File "COPYING.GPL"
55 File "COPYING.GPL3"
56 File "lsnesgb-sdl.exe"
57 File "lsnesgb-wxwidgets.exe"
58 File "lsnes-sdl.exe"
59 File "lsnes-wxwidgets.exe"
60 File "sources.tar"
61 File "lsnes.nsi"
62 File "manual.txt"
64 File /r "buildoptions"
65 File /r "data"
66 SectionEnd
68 Section -AdditionalIcons
69 SetShellVarContext all
70 CreateDirectory "$SMPROGRAMS\${INSTALL_DIR}"
71 CreateShortCut "$SMPROGRAMS\${INSTALL_DIR}\Super Nintendo Emulator.lnk" "$INSTDIR\lsnes-wxwidgets.exe"
72 CreateShortCut "$SMPROGRAMS\${INSTALL_DIR}\Gameboy Emulator.lnk" "$INSTDIR\lsnesgb-wxwidgets.exe"
73 WriteIniStr "$SMPROGRAMS\${INSTALL_DIR}\${PRODUCT_NAME} website.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
74 CreateShortCut "$SMPROGRAMS\${INSTALL_DIR}\Manual.lnk" "$INSTDIR\manual.txt"
75 CreateShortCut "$SMPROGRAMS\${INSTALL_DIR}\Uninstall.lnk" "$INSTDIR\uninst.exe"
76 SectionEnd
78 Section -Post
79 SetShellVarContext all
80 WriteUninstaller "$INSTDIR\uninst.exe"
81 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
82 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
83 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
84 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
85 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
86 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DIR" "$INSTDIR"
87 SectionEnd
90 Function un.onUninstSuccess
91 HideWindow
92 MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
93 FunctionEnd
95 Function un.onInit
96 MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES Done
97 Abort
98 Done:
99 FunctionEnd
101 Section Uninstall
102 SetShellVarContext all
104 RMDir /R "$SMPROGRAMS\${INSTALL_DIR}"
105 RMdir /R "$INSTDIR"
107 DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
108 SetAutoClose true
109 SectionEnd