11; ======================================================
22; Include
3-
3+
44!include " MUI2.nsh"
5+ !include LogicLib.nsh
6+ !include x64.nsh
57
68; ======================================================
79; Version Information
810
911!define UNINST_PATH " Software\Microsoft\Windows\CurrentVersion\Uninstall\ighp"
1012
1113!define APP_NAME " iTunes Global Hotkeys Plugin"
12- !define VERSION " 0.1.0"
14+ !define VERSION " 0.1.1"
15+ ; !define IS64BIT
1316
1417VIProductVersion " ${VERSION}.0"
1518VIAddVersionKey /LANG= ${LANG_ENGLISH} " ProductName" " ${APP_NAME}"
16- VIAddVersionKey /LANG= ${LANG_ENGLISH} " LegalCopyright" " Copyright (c) 2011 Stefan Cosma, pezcode"
19+ VIAddVersionKey /LANG= ${LANG_ENGLISH} " LegalCopyright" " Copyright (c) 2015 Stefan Cosma, pezcode"
1720VIAddVersionKey /LANG= ${LANG_ENGLISH} " FileDescription" " ${APP_NAME} Setup"
1821VIAddVersionKey /LANG= ${LANG_ENGLISH} " FileVersion" " ${VERSION}.0"
1922
2023; ======================================================
2124; Installer Information
22-
25+
2326Name " ${APP_NAME}"
24- OutFile " ighp_${VERSION}.exe"
25- InstallDir " $PROGRAMFILES\iTunes\Plug-ins"
27+ !ifdef IS64BIT
28+ OutFile " ighp_${VERSION}_x64.exe"
29+ InstallDir " $PROGRAMFILES64\iTunes\Plug-ins"
30+ !else
31+ OutFile " ighp_${VERSION}.exe"
32+ InstallDir " $PROGRAMFILES\iTunes\Plug-ins"
33+ !endif
2634
2735; ======================================================
2836; Request application privileges for Windows Vista
2937RequestExecutionLevel admin
3038
3139; ======================================================
3240; Modern Interface Configuration
33-
41+
3442!define MUI_ABORTWARNING
3543!define MUI_FINISHPAGE
3644!define MUI_FINISHPAGE_TEXT " Thank you for installing ${APP_NAME}. You need to restart iTunes before using the plugin."
3745
3846; ======================================================
3947; Pages
40-
48+
4149!insertmacro MUI_PAGE_WELCOME
4250!insertmacro MUI_PAGE_LICENSE License .txt
4351!insertmacro MUI_PAGE_DIRECTORY
@@ -49,13 +57,25 @@ RequestExecutionLevel admin
4957
5058; ======================================================
5159; Languages
52-
60+
5361!insertmacro MUI_LANGUAGE " English"
5462
5563; ======================================================
5664; Sections
5765
58- Section " VersionCheck" versionCheck
66+ Section " 64BitCheck"
67+
68+ !ifdef IS64BIT
69+ ${IfNot} ${RunningX64}
70+ MessageBox MB_OK |MB_ICONEXCLAMATION " You are trying to install a 64-bit version of ${APP_NAME} on a 32-bit Windows.\r$\n \
71+ Please use the appropriate 32-bit setup."
72+ Quit
73+ ${EndIf}
74+ !endif
75+
76+ SectionEnd
77+
78+ Section " VersionCheck"
5979
6080 Push $0
6181
@@ -76,13 +96,13 @@ check_new:
7696 ; StrCmp $0 "0.0.3" abort_version
7797 ; StrCmp $0 "0.0.2" abort_version
7898 ; StrCmp $0 "0.0.1" abort_version
79-
99+
80100 goto end
81-
101+
82102abort_version:
83103
84104 MessageBox MB_OK |MB_ICONEXCLAMATION " Found an incompatible version of ${APP_NAME}$\r$\n \
85- Please remove it before installing a new version."
105+ Please remove it before installing a new version."
86106 Quit
87107
88108end:
@@ -91,22 +111,26 @@ end:
91111
92112SectionEnd
93113
94- Section " Plugin" pluginSection
114+ Section " Plugin"
95115
96116 SetOutPath $INSTDIR
97-
98- File " release\GlobalHotkeys.dll"
117+
118+ !ifdef IS64BIT
119+ File " x64\release\GlobalHotkeys.dll"
120+ !else
121+ File " release\GlobalHotkeys.dll"
122+ !endif
99123 File " /oname=Global Hotkeys License.txt" " License.txt"
100- File " /oname=Global Hotkeys Readme.txt" " Readme.txt"
101-
124+ File " /oname=Global Hotkeys Readme.txt" " Readme.txt"
125+
102126 ; Create uninstaller
103-
127+
104128 WriteUninstaller " $INSTDIR\UninstallGlobalHotkeys.exe"
105129 WriteRegStr HKLM " ${UNINST_PATH}" " DisplayName" " iTunes Global Hotkeys Plugin"
106130 WriteRegStr HKLM " ${UNINST_PATH}" " UninstallString" " $\" $INSTDIR\UninstallGlobalHotkeys.exe$\" "
107131 WriteRegStr HKLM " ${UNINST_PATH}" " Publisher" " pezcode"
108132 WriteRegStr HKLM " ${UNINST_PATH}" " URLInfoAbout" " http://pezcode.github.com/ighp/"
109- WriteRegStr HKLM " ${UNINST_PATH}" " DisplayVersion" " ${VERSION}"
133+ WriteRegStr HKLM " ${UNINST_PATH}" " DisplayVersion" " ${VERSION}"
110134 WriteRegDWORD HKLM " ${UNINST_PATH}" " NoModify" 1
111135 WriteRegDWORD HKLM " ${UNINST_PATH}" " NoRepair" 1
112136
0 commit comments