install-multi-arch.iss 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  1. ; OpenMPT Install script
  2. ; https://openmpt.org/
  3. #define BuildFolder "release\vs2019-win10-static"
  4. #define BuildFolderLegacyx86 "release\vs2019-win7-static"
  5. #define BuildFolderLegacyamd64 "release\vs2019-win7-static"
  6. #define DefaultArchName "x86"
  7. #define GetAppVersion GetFileProductVersion("..\bin\" + BuildFolder + "\" + DefaultArchName + "\OpenMPT.exe")
  8. #define GetAppVersionMedium Copy(GetAppVersion, 1, 7)
  9. #define GetAppVersionShort Copy(GetAppVersion, 1, 4)
  10. [Setup]
  11. AlwaysShowComponentsList=no
  12. AppId={{40c97d3e-7763-4b88-8c6a-0901befee4af}
  13. AppVerName=OpenMPT {#GetAppVersion}
  14. AppVersion={#GetAppVersion}
  15. AppName=OpenMPT
  16. AppPublisher=OpenMPT
  17. AppPublisherURL=https://openmpt.org/
  18. AppSupportURL=https://forum.openmpt.org/
  19. AppUpdatesURL=https://openmpt.org/
  20. ArchitecturesInstallIn64BitMode=x64 arm64 ia64
  21. ChangesAssociations=yes
  22. Compression=lzma2/ultra64
  23. ;DefaultDirName={autopf}\OpenMPT
  24. DefaultDirName={code:CodeGetDefaultDirName|}
  25. DefaultGroupName=OpenMPT
  26. DirExistsWarning=auto
  27. DisableDirPage=auto
  28. AlwaysShowDirOnReadyPage=yes
  29. DisableProgramGroupPage=yes
  30. DisableReadyMemo=no
  31. DisableWelcomePage=no
  32. MinVersion=6.1sp1
  33. OutputDir=.\
  34. OutputBaseFilename=OpenMPT-{#GetAppVersion}-Setup
  35. PrivilegesRequired=admin
  36. PrivilegesRequiredOverridesAllowed=commandline dialog
  37. SetupIconFile=..\mptrack\res\MPTRACK.ICO
  38. SolidCompression=yes
  39. TimeStampsInUTC=yes
  40. UninstallDisplayIcon={app}\OpenMPT App Icon.ico
  41. VersionInfoCopyright=Copyright © 2004-2022 OpenMPT Project Developers and Contributors, Copyright © 1997-2003 Olivier Lapicque
  42. VersionInfoProductTextVersion={#GetAppVersion}
  43. VersionInfoProductVersion={#GetAppVersion}
  44. VersionInfoTextVersion={#GetAppVersion}
  45. VersionInfoVersion={#GetAppVersion}
  46. WizardImageFile=install-big.bmp
  47. WizardSmallImageFile=install-small.bmp
  48. WizardStyle=modern
  49. [Types]
  50. Name: "default"; Description: "Default installation"; Flags: iscustom
  51. [Components]
  52. Name: "archx86"; Description: "OpenMPT x86"; Types: default; Flags: fixed disablenouninstallwarning
  53. Name: "archamd64"; Description: "OpenMPT amd64"; Types: default; Flags: fixed disablenouninstallwarning
  54. Name: "archarm"; Description: "OpenMPT arm"; Types: default; Flags: fixed disablenouninstallwarning
  55. Name: "archarm64"; Description: "OpenMPT arm64"; Types: default; Flags: fixed disablenouninstallwarning
  56. [Languages]
  57. Name: en; MessagesFile: compiler:Default.isl
  58. [Files]
  59. ; note: packageTemplate\ contains files specific for the "install package".
  60. ; for files that are common with the "zip package", use ..\packageTemplate\
  61. Source: ..\bin\{#BuildFolder}\x86\OpenMPT.exe; DestDir: {app}\bin\x86; Flags: ignoreversion; Components: archx86; MinVersion: 10.0
  62. Source: ..\bin\{#BuildFolder}\x86\PluginBridge-x86.exe; DestDir: {app}\bin\x86; Flags: ignoreversion; Components: archx86; MinVersion: 10.0
  63. Source: ..\bin\{#BuildFolder}\x86\PluginBridgeLegacy-x86.exe; DestDir: {app}\bin\x86; Flags: ignoreversion; Components: archx86; MinVersion: 10.0
  64. Source: ..\bin\{#BuildFolder}\x86\openmpt-lame.dll; DestDir: {app}\bin\x86; Flags: ignoreversion; Components: archx86; MinVersion: 10.0
  65. Source: ..\bin\{#BuildFolder}\x86\openmpt-mpg123.dll; DestDir: {app}\bin\x86; Flags: ignoreversion; Components: archx86; MinVersion: 10.0
  66. Source: ..\bin\{#BuildFolder}\x86\openmpt-soundtouch.dll; DestDir: {app}\bin\x86; Flags: ignoreversion; Components: archx86; MinVersion: 10.0
  67. Source: ..\bin\{#BuildFolderLegacyx86}\x86\OpenMPT.exe; DestDir: {app}\bin\x86; Flags: ignoreversion; Components: archx86; OnlyBelowVersion: 10.0
  68. Source: ..\bin\{#BuildFolderLegacyx86}\x86\PluginBridge-x86.exe; DestDir: {app}\bin\x86; Flags: ignoreversion; Components: archx86; OnlyBelowVersion: 10.0
  69. Source: ..\bin\{#BuildFolderLegacyx86}\x86\PluginBridgeLegacy-x86.exe; DestDir: {app}\bin\x86; Flags: ignoreversion; Components: archx86; OnlyBelowVersion: 10.0
  70. Source: ..\bin\{#BuildFolderLegacyx86}\x86\openmpt-lame.dll; DestDir: {app}\bin\x86; Flags: ignoreversion; Components: archx86; OnlyBelowVersion: 10.0
  71. Source: ..\bin\{#BuildFolderLegacyx86}\x86\openmpt-mpg123.dll; DestDir: {app}\bin\x86; Flags: ignoreversion; Components: archx86; OnlyBelowVersion: 10.0
  72. Source: ..\bin\{#BuildFolderLegacyx86}\x86\openmpt-soundtouch.dll; DestDir: {app}\bin\x86; Flags: ignoreversion; Components: archx86; OnlyBelowVersion: 10.0
  73. Source: ..\bin\{#BuildFolder}\amd64\OpenMPT.exe; DestDir: {app}\bin\amd64; Flags: ignoreversion; Components: archamd64; MinVersion: 10.0
  74. Source: ..\bin\{#BuildFolder}\amd64\PluginBridge-amd64.exe; DestDir: {app}\bin\amd64; Flags: ignoreversion; Components: archamd64; MinVersion: 10.0
  75. Source: ..\bin\{#BuildFolder}\amd64\PluginBridgeLegacy-amd64.exe; DestDir: {app}\bin\amd64; Flags: ignoreversion; Components: archamd64; MinVersion: 10.0
  76. Source: ..\bin\{#BuildFolder}\amd64\openmpt-lame.dll; DestDir: {app}\bin\amd64; Flags: ignoreversion; Components: archamd64; MinVersion: 10.0
  77. Source: ..\bin\{#BuildFolder}\amd64\openmpt-mpg123.dll; DestDir: {app}\bin\amd64; Flags: ignoreversion; Components: archamd64; MinVersion: 10.0
  78. Source: ..\bin\{#BuildFolder}\amd64\openmpt-soundtouch.dll; DestDir: {app}\bin\amd64; Flags: ignoreversion; Components: archamd64; MinVersion: 10.0
  79. Source: ..\bin\{#BuildFolderLegacyamd64}\amd64\OpenMPT.exe; DestDir: {app}\bin\amd64; Flags: ignoreversion; Components: archamd64; OnlyBelowVersion: 10.0
  80. Source: ..\bin\{#BuildFolderLegacyamd64}\amd64\PluginBridge-amd64.exe; DestDir: {app}\bin\amd64; Flags: ignoreversion; Components: archamd64; OnlyBelowVersion: 10.0
  81. Source: ..\bin\{#BuildFolderLegacyamd64}\amd64\PluginBridgeLegacy-amd64.exe; DestDir: {app}\bin\amd64; Flags: ignoreversion; Components: archamd64; OnlyBelowVersion: 10.0
  82. Source: ..\bin\{#BuildFolderLegacyamd64}\amd64\openmpt-lame.dll; DestDir: {app}\bin\amd64; Flags: ignoreversion; Components: archamd64; OnlyBelowVersion: 10.0
  83. Source: ..\bin\{#BuildFolderLegacyamd64}\amd64\openmpt-mpg123.dll; DestDir: {app}\bin\amd64; Flags: ignoreversion; Components: archamd64; OnlyBelowVersion: 10.0
  84. Source: ..\bin\{#BuildFolderLegacyamd64}\amd64\openmpt-soundtouch.dll; DestDir: {app}\bin\amd64; Flags: ignoreversion; Components: archamd64; OnlyBelowVersion: 10.0
  85. Source: ..\bin\{#BuildFolder}\arm\OpenMPT.exe; DestDir: {app}\bin\arm; Flags: ignoreversion; Components: archarm
  86. Source: ..\bin\{#BuildFolder}\arm\PluginBridge-arm.exe; DestDir: {app}\bin\arm; Flags: ignoreversion; Components: archarm
  87. Source: ..\bin\{#BuildFolder}\arm\PluginBridgeLegacy-arm.exe; DestDir: {app}\bin\arm; Flags: ignoreversion; Components: archarm
  88. Source: ..\bin\{#BuildFolder}\arm\openmpt-lame.dll; DestDir: {app}\bin\arm; Flags: ignoreversion; Components: archarm
  89. Source: ..\bin\{#BuildFolder}\arm\openmpt-mpg123.dll; DestDir: {app}\bin\arm; Flags: ignoreversion; Components: archarm
  90. Source: ..\bin\{#BuildFolder}\arm\openmpt-soundtouch.dll; DestDir: {app}\bin\arm; Flags: ignoreversion; Components: archarm
  91. Source: ..\bin\{#BuildFolder}\arm64\OpenMPT.exe; DestDir: {app}\bin\arm64; Flags: ignoreversion; Components: archarm64
  92. Source: ..\bin\{#BuildFolder}\arm64\PluginBridge-arm64.exe; DestDir: {app}\bin\arm64; Flags: ignoreversion; Components: archarm64
  93. Source: ..\bin\{#BuildFolder}\arm64\PluginBridgeLegacy-arm64.exe; DestDir: {app}\bin\arm64; Flags: ignoreversion; Components: archarm64
  94. Source: ..\bin\{#BuildFolder}\arm64\openmpt-lame.dll; DestDir: {app}\bin\arm64; Flags: ignoreversion; Components: archarm64
  95. Source: ..\bin\{#BuildFolder}\arm64\openmpt-mpg123.dll; DestDir: {app}\bin\arm64; Flags: ignoreversion; Components: archarm64
  96. Source: ..\bin\{#BuildFolder}\arm64\openmpt-soundtouch.dll; DestDir: {app}\bin\arm64; Flags: ignoreversion; Components: archarm64
  97. Source: "..\mptrack\res\MPTRACK.ICO"; DestName: "OpenMPT App Icon.ico"; DestDir: "{app}"; Flags: ignoreversion
  98. Source: "..\packageTemplate\OpenMPT File Icon.ico"; DestName: "OpenMPT File Icon.ico"; DestDir: "{app}"; Flags: ignoreversion
  99. Source: ..\bin\{#BuildFolder}\{#DefaultArchName}\openmpt-wine-support.zip; DestDir: {app}; Flags: ignoreversion
  100. ; todo: use proper folder
  101. Source: ..\packageTemplate\ExampleSongs\*.*; DestDir: {app}\ExampleSongs\; Flags: ignoreversion recursesubdirs
  102. Source: packageTemplate\readme.txt; DestDir: {app}; Flags: ignoreversion
  103. Source: ..\packageTemplate\History.txt; DestDir: {app}; Flags: ignoreversion
  104. Source: ..\packageTemplate\OpenMPT Manual.chm; DestDir: {app}; Flags: ignoreversion
  105. Source: ..\packageTemplate\ReleaseNotesImages\*.*; DestDir: {app}\ReleaseNotesImages\; Flags: ignoreversion
  106. Source: ..\packageTemplate\Release Notes.html; DestDir: {app}; Flags: ignoreversion
  107. Source: ..\packageTemplate\OpenMPT Support and Community Forum.url; DestDir: {app}; Flags: ignoreversion
  108. Source: ..\packageTemplate\OpenMPT Issue Tracker.url; DestDir: {app}; Flags: ignoreversion
  109. Source: ..\packageTemplate\License.txt; DestDir: {app}; Flags: ignoreversion
  110. Source: ..\packageTemplate\Licenses\*.*; DestDir: {app}\Licenses; Flags: ignoreversion
  111. Source: ..\packageTemplate\ExtraKeymaps\*.*; DestDir: {app}\ExtraKeymaps; Flags: ignoreversion
  112. [Icons]
  113. Name: {autodesktop}\OpenMPT; Filename: {app}\bin\x86\OpenMPT.exe; Check: CheckDefaultArch('x86')
  114. Name: {autodesktop}\OpenMPT; Filename: {app}\bin\amd64\OpenMPT.exe; Check: CheckDefaultArch('amd64')
  115. Name: {autodesktop}\OpenMPT; Filename: {app}\bin\arm\OpenMPT.exe; Check: CheckDefaultArch('arm')
  116. Name: {autodesktop}\OpenMPT; Filename: {app}\bin\arm64\OpenMPT.exe; Check: CheckDefaultArch('arm64')
  117. Name: {group}\OpenMPT; Filename: {app}\bin\x86\OpenMPT.exe; Check: CheckDefaultArch('x86')
  118. Name: {group}\OpenMPT; Filename: {app}\bin\amd64\OpenMPT.exe; Check: CheckDefaultArch('amd64')
  119. Name: {group}\OpenMPT; Filename: {app}\bin\arm\OpenMPT.exe; Check: CheckDefaultArch('arm')
  120. Name: {group}\OpenMPT; Filename: {app}\bin\arm64\OpenMPT.exe; Check: CheckDefaultArch('arm64')
  121. Name: {group}\OpenMPT (x86); Filename: {app}\bin\x86\OpenMPT.exe; Components: archx86
  122. Name: {group}\OpenMPT (amd64); Filename: {app}\bin\amd64\OpenMPT.exe; Components: archamd64
  123. Name: {group}\OpenMPT (arm); Filename: {app}\bin\arm\OpenMPT.exe; Components: archarm
  124. Name: {group}\OpenMPT (arm64); Filename: {app}\bin\arm64\OpenMPT.exe; Components: archarm64
  125. Name: {group}\Manual; Filename: {app}\OpenMPT Manual.chm
  126. Name: {group}\Support and Community Forum; Filename: {app}\OpenMPT Support and Community Forum.url
  127. [Registry]
  128. #include "filetypes-multi-arch.iss"
  129. [Run]
  130. Filename: "{app}\Release Notes.html"; Description: "View Release Notes"; Flags: runasoriginaluser shellexec nowait postinstall skipifsilent
  131. Filename: {app}\bin\x86\OpenMPT.exe; Parameters: """{code:RandomExampleFile}"""; Description: {cm:LaunchProgram,OpenMPT}; Flags: runasoriginaluser nowait postinstall skipifsilent; Check: CheckDefaultArch('x86')
  132. Filename: {app}\bin\amd64\OpenMPT.exe; Parameters: """{code:RandomExampleFile}"""; Description: {cm:LaunchProgram,OpenMPT}; Flags: runasoriginaluser nowait postinstall skipifsilent; Check: CheckDefaultArch('amd64')
  133. Filename: {app}\bin\arm\OpenMPT.exe; Parameters: """{code:RandomExampleFile}"""; Description: {cm:LaunchProgram,OpenMPT}; Flags: runasoriginaluser nowait postinstall skipifsilent; Check: CheckDefaultArch('arm')
  134. Filename: {app}\bin\arm64\OpenMPT.exe; Parameters: """{code:RandomExampleFile}"""; Description: {cm:LaunchProgram,OpenMPT}; Flags: runasoriginaluser nowait postinstall skipifsilent; Check: CheckDefaultArch('arm64')
  135. [InstallDelete]
  136. ; as recommended by Inno Setup manual on [Components]
  137. Type: files; Name: {app}\bin\x86\OpenMPT.exe
  138. Type: files; Name: {app}\bin\x86\PluginBridge-x86.exe
  139. Type: files; Name: {app}\bin\x86\PluginBridgeLegacy-x86.exe
  140. Type: files; Name: {app}\bin\x86\openmpt-lame.dll
  141. Type: files; Name: {app}\bin\x86\openmpt-mpg123.dll
  142. Type: files; Name: {app}\bin\x86\openmpt-soundtouch.dll
  143. Type: files; Name: {app}\bin\amd64\OpenMPT.exe
  144. Type: files; Name: {app}\bin\amd64\PluginBridge-amd64.exe
  145. Type: files; Name: {app}\bin\amd64\PluginBridgeLegacy-amd64.exe
  146. Type: files; Name: {app}\bin\amd64\openmpt-lame.dll
  147. Type: files; Name: {app}\bin\amd64\openmpt-mpg123.dll
  148. Type: files; Name: {app}\bin\amd64\openmpt-soundtouch.dll
  149. Type: files; Name: {app}\bin\arm\OpenMPT.exe
  150. Type: files; Name: {app}\bin\arm\PluginBridge-arm.exe
  151. Type: files; Name: {app}\bin\arm\PluginBridgeLegacy-arm.exe
  152. Type: files; Name: {app}\bin\arm\openmpt-lame.dll
  153. Type: files; Name: {app}\bin\arm\openmpt-mpg123.dll
  154. Type: files; Name: {app}\bin\arm\openmpt-soundtouch.dll
  155. Type: files; Name: {app}\bin\arm64\OpenMPT.exe
  156. Type: files; Name: {app}\bin\arm64\PluginBridge-arm64.exe
  157. Type: files; Name: {app}\bin\arm64\PluginBridgeLegacy-arm64.exe
  158. Type: files; Name: {app}\bin\arm64\openmpt-lame.dll
  159. Type: files; Name: {app}\bin\arm64\openmpt-mpg123.dll
  160. Type: files; Name: {app}\bin\arm64\openmpt-soundtouch.dll
  161. #include "uninstall-single-arch.iss"
  162. [Code]
  163. procedure InitializeWizard();
  164. begin
  165. WizardSelectComponents('archx86,!archamd64,!archarm,!archarm64');
  166. case ProcessorArchitecture() of
  167. paUnknown:
  168. begin
  169. WizardSelectComponents('archx86,!archamd64,!archarm,!archarm64');
  170. end;
  171. paX86:
  172. begin
  173. WizardSelectComponents('archx86,!archamd64,!archarm,!archarm64');
  174. end;
  175. paX64:
  176. begin
  177. WizardSelectComponents('archx86,archamd64,!archarm,!archarm64');
  178. end;
  179. paIA64:
  180. begin
  181. WizardSelectComponents('archx86,!archamd64,!archarm,!archarm64');
  182. end;
  183. paARM64:
  184. begin
  185. WizardSelectComponents('archx86,archamd64,archarm,archarm64');
  186. end;
  187. end;
  188. end;
  189. function GetDefaultArch(): String;
  190. begin
  191. Result := 'x86';
  192. case ProcessorArchitecture() of
  193. paUnknown:
  194. begin
  195. Result := 'x86';
  196. end;
  197. paX86:
  198. begin
  199. Result := 'x86';
  200. end;
  201. paX64:
  202. begin
  203. Result := 'amd64';
  204. end;
  205. paIA64:
  206. begin
  207. Result := 'x86';
  208. end;
  209. paARM64:
  210. begin
  211. Result := 'arm64';
  212. end;
  213. end;
  214. end;
  215. function CodeGetDefaultArch(Param: String): String;
  216. begin
  217. Result := GetDefaultArch();
  218. end;
  219. function CheckDefaultArch(Arch: String): Boolean;
  220. begin
  221. Result := Arch = GetDefaultArch();
  222. end;
  223. function ShouldSkipPage(PageID: Integer): Boolean;
  224. begin
  225. Result := False;
  226. case PageID of
  227. wpSelectDir:
  228. begin
  229. Result := IsAdmin() and HasPreviousSingleArchInstallPath();
  230. end;
  231. end;
  232. case PageID of
  233. wpSelectComponents:
  234. begin
  235. Result := True;
  236. end;
  237. end;
  238. end;
  239. procedure CurStepChanged(CurStep: TSetupStep);
  240. begin
  241. case CurStep of
  242. ssInstall:
  243. begin
  244. if not UninstallSingleArch() then
  245. begin
  246. RaiseException('Uninstallation of previous OpenMPT installation failed. Please uninstall manually.');
  247. end;
  248. end;
  249. end;
  250. end;
  251. // Picks a random example song file to play
  252. Function RandomExampleFile(Dummy: String): String;
  253. var
  254. Files: TstringList;
  255. FindRec: TFindRec;
  256. begin
  257. Result := '';
  258. if FindFirst(ExpandConstant('{app}\ExampleSongs\*'), FindRec) then
  259. try
  260. Files := TstringList.Create;
  261. repeat
  262. if FindRec.Attributes and FILE_ATTRIBUTE_DIRECTORY = 0 then
  263. Files.Add(FindRec.Name);
  264. until not FindNext(FindRec);
  265. Result := ExpandConstant('{app}\ExampleSongs\') + Files[Random(Files.Count)];
  266. finally
  267. FindClose(FindRec);
  268. end;
  269. end;
  270. function CodeGetDefaultDirName(Param: String): String;
  271. begin
  272. if IsAdmin() and HasPreviousSingleArchInstallPath() then
  273. begin
  274. Result := GetPreviousSingleArchInstallPath();
  275. end
  276. else
  277. begin
  278. Result := ExpandConstant('{autopf}\OpenMPT');
  279. end;
  280. end;