supertux32.iss 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. ; Supertux setup script. Process this script with InnoSetup
  2. ;
  3. ; Assumes the following was already done:
  4. ;
  5. ; rm -fr /build/supertux/build/innosetup
  6. ; ./autogen.sh
  7. ; LIBS="-L/usr/local/lib -lvorbisenc -lvorbisfile -lvorbis -logg" CFLAGS="-I/usr/local/include" configure
  8. ; jam
  9. ; jam -sDESTDIR="/build/supertux/build/innosetup" install
  10. ;
  11. #define MyAppName "SuperTux"
  12. #define MyAppVer "0.4.0"
  13. #define MyAppVerName "SuperTux 0.4.0"
  14. #define MyAppPublisher "SuperTux Development Team"
  15. #define MyAppURL "http://supertux.lethargik.org"
  16. #define MyAppExeName "supertux2.exe"
  17. #define RootDir "..\.."
  18. #define DependencyDir "..\..\dependencies32"
  19. #define BuildDir "..\..\Release"
  20. #define DllSourceDir "C:\msys\1.0\build\supertux"
  21. [Setup]
  22. AppName={#MyAppName}
  23. AppVerName={#MyAppVerName}
  24. AppPublisher={#MyAppPublisher}
  25. AppPublisherURL={#MyAppURL}
  26. AppSupportURL={#MyAppURL}
  27. AppUpdatesURL={#MyAppURL}
  28. DefaultDirName={pf}\{#MyAppVerName}
  29. DefaultGroupName={#MyAppVerName}
  30. ShowLanguageDialog=yes
  31. SolidCompression=true
  32. OutputBaseFilename=supertux-{#MyAppVer}-win32-setup
  33. AllowNoIcons=true
  34. AppID={{4BEF4147-E17A-4848-BDC4-60A0AAC70F2A}
  35. VersionInfoVersion=0.3
  36. VersionInfoTextVersion={#MyAppVerName}
  37. AppVersion={#MyAppVer}
  38. UninstallDisplayName={#MyAppVerName}
  39. LicenseFile={#RootDir}\LICENSE
  40. SetupIconFile={#RootDir}\tools\innosetup\{#MyAppName}.ico
  41. Compression=lzma2
  42. [Tasks]
  43. Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked
  44. [Languages]
  45. Name: "english"; MessagesFile: "compiler:Default.isl"
  46. Name: "brazilianportuguese"; MessagesFile: "compiler:Languages\BrazilianPortuguese.isl"
  47. Name: "catalan"; MessagesFile: "compiler:Languages\Catalan.isl"
  48. Name: "corsican"; MessagesFile: "compiler:Languages\Corsican.isl"
  49. Name: "czech"; MessagesFile: "compiler:Languages\Czech.isl"
  50. Name: "danish"; MessagesFile: "compiler:Languages\Danish.isl"
  51. Name: "dutch"; MessagesFile: "compiler:Languages\Dutch.isl"
  52. Name: "finnish"; MessagesFile: "compiler:Languages\Finnish.isl"
  53. Name: "french"; MessagesFile: "compiler:Languages\French.isl"
  54. Name: "german"; MessagesFile: "compiler:Languages\German.isl"
  55. Name: "greek"; MessagesFile: "compiler:Languages\Greek.isl"
  56. Name: "hebrew"; MessagesFile: "compiler:Languages\Hebrew.isl"
  57. Name: "hungarian"; MessagesFile: "compiler:Languages\Hungarian.isl"
  58. Name: "italian"; MessagesFile: "compiler:Languages\Italian.isl"
  59. Name: "japanese"; MessagesFile: "compiler:Languages\Japanese.isl"
  60. Name: "norwegian"; MessagesFile: "compiler:Languages\Norwegian.isl"
  61. Name: "polish"; MessagesFile: "compiler:Languages\Polish.isl"
  62. Name: "portuguese"; MessagesFile: "compiler:Languages\Portuguese.isl"
  63. Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
  64. Name: "scottishgaelic"; MessagesFile: "compiler:Languages\ScottishGaelic.isl"
  65. Name: "serbiancyrillic"; MessagesFile: "compiler:Languages\SerbianCyrillic.isl"
  66. Name: "serbianlatin"; MessagesFile: "compiler:Languages\SerbianLatin.isl"
  67. Name: "slovenian"; MessagesFile: "compiler:Languages\Slovenian.isl"
  68. Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"
  69. Name: "turkish"; MessagesFile: "compiler:Languages\Turkish.isl"
  70. Name: "ukrainian"; MessagesFile: "compiler:Languages\Ukrainian.isl"
  71. [Files]
  72. Source: {#DependencyDir}\vcredist_x86.exe; DestDir: {tmp}; Flags: deleteafterinstall
  73. Source: {#BuildDir}\supertux2.exe; DestDir: {app}; Flags: ignoreversion
  74. Source: {#RootDir}\LICENSE; DestDir: {app}; Flags: ignoreversion
  75. Source: {#RootDir}\README.md; DestDir: {app}; Flags: ignoreversion
  76. Source: {#RootDir}\INSTALL.md; DestDir: {app}; Flags: ignoreversion
  77. Source: {#RootDir}\NEWS.md; DestDir: {app}; Flags: ignoreversion
  78. Source: {#BuildDir}\*.dll; DestDir: {app}; Flags: ignoreversion
  79. Source: {#BuildDir}\*.pem; DestDir: {app}\data; Flags: ignoreversion
  80. Source: {#RootDir}\data\*; DestDir: {app}\data; Flags: ignoreversion recursesubdirs createallsubdirs
  81. Source: {#DependencyDir}\licenses\*; DestDir: {app}\licenses; Flags: ignoreversion recursesubdirs createallsubdirs
  82. Source: {#MyAppName}.ico; DestDir: {app}; Flags: ignoreversion
  83. [Icons]
  84. Name: {group}\{#MyAppName}; Filename: {app}\{#MyAppExeName}; IconFilename: {app}\{#MyAppName}.ico
  85. Name: {group}\{cm:UninstallProgram,{#MyAppName}}; Filename: {uninstallexe}
  86. Name: {userdesktop}\{#MyAppName}; Filename: {app}\{#MyAppExeName}; IconFilename: {app}\{#MyAppName}.ico; Tasks: desktopicon
  87. [Run]
  88. Filename: {tmp}\vcredist_x86.exe; Parameters: "/quiet /norestart"; StatusMsg: Installing Visual C++ runtime...; Check: VCRedistNeedsInstall
  89. Filename: {app}\{#MyAppExeName}; Description: {cm:LaunchProgram,{#MyAppName}}; Flags: nowait postinstall skipifsilent
  90. [UninstallDelete]
  91. Type: filesandordirs; Name: {app}\stdout.txt
  92. Type: filesandordirs; Name: {app}\stderr.txt
  93. [Code]
  94. // Taken from http://stackoverflow.com/a/11172939
  95. #IFDEF UNICODE
  96. #DEFINE AW "W"
  97. #ELSE
  98. #DEFINE AW "A"
  99. #ENDIF
  100. type
  101. INSTALLSTATE = Longint;
  102. const
  103. INSTALLSTATE_INVALIDARG = -2; // An invalid parameter was passed to the function.
  104. INSTALLSTATE_UNKNOWN = -1; // The product is neither advertised or installed.
  105. INSTALLSTATE_ADVERTISED = 1; // The product is advertised but not installed.
  106. INSTALLSTATE_ABSENT = 2; // The product is installed for a different user.
  107. INSTALLSTATE_DEFAULT = 5; // The product is installed for the current user.
  108. VC_2005_REDIST_X86 = '{A49F249F-0C91-497F-86DF-B2585E8E76B7}';
  109. VC_2005_REDIST_X64 = '{6E8E85E8-CE4B-4FF5-91F7-04999C9FAE6A}';
  110. VC_2005_REDIST_IA64 = '{03ED71EA-F531-4927-AABD-1C31BCE8E187}';
  111. VC_2005_SP1_REDIST_X86 = '{7299052B-02A4-4627-81F2-1818DA5D550D}';
  112. VC_2005_SP1_REDIST_X64 = '{071C9B48-7C32-4621-A0AC-3F809523288F}';
  113. VC_2005_SP1_REDIST_IA64 = '{0F8FB34E-675E-42ED-850B-29D98C2ECE08}';
  114. VC_2005_SP1_ATL_SEC_UPD_REDIST_X86 = '{837B34E3-7C30-493C-8F6A-2B0F04E2912C}';
  115. VC_2005_SP1_ATL_SEC_UPD_REDIST_X64 = '{6CE5BAE9-D3CA-4B99-891A-1DC6C118A5FC}';
  116. VC_2005_SP1_ATL_SEC_UPD_REDIST_IA64 = '{85025851-A784-46D8-950D-05CB3CA43A13}';
  117. VC_2008_REDIST_X86 = '{FF66E9F6-83E7-3A3E-AF14-8DE9A809A6A4}';
  118. VC_2008_REDIST_X64 = '{350AA351-21FA-3270-8B7A-835434E766AD}';
  119. VC_2008_REDIST_IA64 = '{2B547B43-DB50-3139-9EBE-37D419E0F5FA}';
  120. VC_2008_SP1_REDIST_X86 = '{9A25302D-30C0-39D9-BD6F-21E6EC160475}';
  121. VC_2008_SP1_REDIST_X64 = '{8220EEFE-38CD-377E-8595-13398D740ACE}';
  122. VC_2008_SP1_REDIST_IA64 = '{5827ECE1-AEB0-328E-B813-6FC68622C1F9}';
  123. VC_2008_SP1_ATL_SEC_UPD_REDIST_X86 = '{1F1C2DFC-2D24-3E06-BCB8-725134ADF989}';
  124. VC_2008_SP1_ATL_SEC_UPD_REDIST_X64 = '{4B6C7001-C7D6-3710-913E-5BC23FCE91E6}';
  125. VC_2008_SP1_ATL_SEC_UPD_REDIST_IA64 = '{977AD349-C2A8-39DD-9273-285C08987C7B}';
  126. VC_2008_SP1_MFC_SEC_UPD_REDIST_X86 = '{9BE518E6-ECC6-35A9-88E4-87755C07200F}';
  127. VC_2008_SP1_MFC_SEC_UPD_REDIST_X64 = '{5FCE6D76-F5DC-37AB-B2B8-22AB8CEDB1D4}';
  128. VC_2008_SP1_MFC_SEC_UPD_REDIST_IA64 = '{515643D1-4E9E-342F-A75A-D1F16448DC04}';
  129. VC_2010_REDIST_X86 = '{196BB40D-1578-3D01-B289-BEFC77A11A1E}';
  130. VC_2010_REDIST_X64 = '{DA5E371C-6333-3D8A-93A4-6FD5B20BCC6E}';
  131. VC_2010_REDIST_IA64 = '{C1A35166-4301-38E9-BA67-02823AD72A1B}';
  132. VC_2010_SP1_REDIST_X86 = '{F0C3E5D1-1ADE-321E-8167-68EF0DE699A5}';
  133. VC_2010_SP1_REDIST_X64 = '{1D8E6291-B0D5-35EC-8441-6616F567A0F7}';
  134. VC_2010_SP1_REDIST_IA64 = '{88C73C1C-2DE5-3B01-AFB8-B46EF4AB41CD}';
  135. // Microsoft Visual C++ 2012 x86 Minimum Runtime - 11.0.61030.0 (Update 4)
  136. VC_2012_REDIST_MIN_UPD4_X86 = '{BD95A8CD-1D9F-35AD-981A-3E7925026EBB}';
  137. VC_2012_REDIST_MIN_UPD4_X64 = '{CF2BEA3C-26EA-32F8-AA9B-331F7E34BA97}';
  138. // Microsoft Visual C++ 2012 x86 Additional Runtime - 11.0.61030.0 (Update 4)
  139. VC_2012_REDIST_ADD_UPD4_X86 = '{B175520C-86A2-35A7-8619-86DC379688B9}';
  140. VC_2012_REDIST_ADD_UPD4_X64 = '{37B8F9C7-03FB-3253-8781-2517C99D7C00}';
  141. // Microsoft Visual C++ 2013
  142. VC_2013_REDIST_X86 = '{13A4EE12-23EA-3371-91EE-EFB36DDFFF3E}';
  143. VC_2013_REDIST_X64 = '{A749D8E6-B613-3BE3-8F5F-045C84EBA29B}';
  144. function MsiQueryProductState(szProduct: string): INSTALLSTATE;
  145. external 'MsiQueryProductState{#AW}@msi.dll stdcall';
  146. function VCVersionInstalled(const ProductID: string): Boolean;
  147. begin
  148. Result := MsiQueryProductState(ProductID) = INSTALLSTATE_DEFAULT;
  149. end;
  150. function VCRedistNeedsInstall: Boolean;
  151. begin
  152. // here the Result must be True when you need to install your VCRedist
  153. // or False when you don't need to, so now it's upon you how you build
  154. // this statement, the following won't install your VC redist only when
  155. // the Visual C++ 2010 Redist (x86) and Visual C++ 2010 SP1 Redist(x86)
  156. // are installed for the current user
  157. Result := not (VCVersionInstalled(VC_2013_REDIST_X86));
  158. end;