supertux-editor.iss 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. ; $Id$
  2. ;
  3. ; Before running this setup:
  4. ; * Copy *.dll and *.pdb and *.exe from the Release bin dir (except Dock.dll and Dock.pdb) to the setup dir.
  5. ; (Make sure to include SDL.dll and SDL_image.dll too!)
  6. ; * Use svn export to create the data dir
  7. ; * Create a file called COPYING.txt that contains the GPL2
  8. #define MyAppName "SuperTux Editor"
  9. #define MyAppVer "0.4.0"
  10. #define MyAppVerName "SuperTux Editor 0.4.0"
  11. #define MyAppMajVerName "SuperTux Editor 0.4"
  12. #define MyAppPublisher "SuperTux Development Team"
  13. #define MyAppURL "http://supertux.lethargik.org"
  14. #define MyAppBaseName "supertux-editor"
  15. [Setup]
  16. AppName={#MyAppName}
  17. AppVerName={#MyAppVerName}
  18. AppPublisher={#MyAppPublisher}
  19. AppPublisherURL={#MyAppURL}
  20. AppSupportURL={#MyAppURL}
  21. AppUpdatesURL={#MyAppURL}
  22. DefaultDirName={pf}\{#MyAppMajVerName}
  23. DefaultGroupName={#MyAppMajVerName}
  24. AllowNoIcons=true
  25. VersionInfoVersion={#MyAppVer}
  26. AppVersion={#MyAppVer}
  27. LicenseFile=COPYING.txt
  28. OutputBaseFilename={#MyAppBaseName}-{#MyAppVer}-win32-setup
  29. Compression=lzma/ultra
  30. SolidCompression=true
  31. AppID={{5D880A65-B01D-4BE4-AC53-A2D21FE4BEF2}
  32. ShowLanguageDialog=yes
  33. DisableStartupPrompt=true
  34. SetupIconFile={#MyAppBaseName}.ico
  35. UninstallDisplayName={#MyAppVerName}
  36. [Languages]
  37. Name: english; MessagesFile: compiler:Default.isl
  38. [Tasks]
  39. Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked
  40. [Files]
  41. Source: {#MyAppBaseName}.exe; DestDir: {app}; Flags: ignoreversion
  42. Source: *.dll; DestDir: {app}; Flags: ignoreversion
  43. Source: data\*.*; DestDir: {app}\data\; Flags: ignoreversion recursesubdirs
  44. Source: {#MyAppBaseName}.ico; DestDir: {app}; Flags: ignoreversion
  45. Source: COPYING.txt; DestDir: {app}; Flags: ignoreversion
  46. Source: *.pdb; DestDir: {app}; Flags: ignoreversion
  47. [Icons]
  48. Name: {group}\{#MyAppMajVerName}; Filename: {app}\{#MyAppBaseName}.exe
  49. Name: {userdesktop}\{#MyAppMajVerName}; Filename: {app}\{#MyAppBaseName}.exe; Tasks: desktopicon
  50. [Run]
  51. Filename: {app}\{#MyAppBaseName}.exe; Description: {cm:LaunchProgram,{#MyAppName}}; Flags: nowait postinstall skipifsilent
  52. [Code]
  53. // This checks if another app that installed using Inno Setup is already installed.
  54. function GetPathInstalled( AppID: String ): String;
  55. var
  56. sPrevPath: String;
  57. begin
  58. sPrevPath := '';
  59. if not RegQueryStringValue(HKLM,
  60. 'Software\Microsoft\Windows\CurrentVersion\Uninstall\'+AppID+'_is1',
  61. 'Inno Setup: App Path', sPrevpath) then
  62. RegQueryStringValue(HKCU, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\'+AppID+'_is1' ,
  63. 'Inno Setup: App Path', sPrevpath);
  64. Result := sPrevPath;
  65. end;
  66. const
  67. // AppID for SuperTux, if you change it in the .iss for supertux change here too!
  68. SuperTuxID = '{4BEF4147-E17A-4848-BDC4-60A0AAC70F2A}';
  69. // Global variable that will contain path to supertux if supertux was installed using Inno Setup
  70. var
  71. SuperTuxPath: String;
  72. function InitializeSetup(): Boolean;
  73. var
  74. ErrorCode: Integer;
  75. NetFrameWorkInstalled: Boolean;
  76. ResultNET: Boolean;
  77. ResultSuperTux: Boolean;
  78. begin
  79. // Check that .NET 2.0 is installed
  80. NetFrameWorkInstalled := RegKeyExists(HKLM,'SOFTWARE\Microsoft\.NETFramework\policy\v2.0');
  81. if NetFrameWorkInstalled = true then
  82. begin
  83. Result := true;
  84. end;
  85. if NetFrameWorkInstalled = false then
  86. begin
  87. ResultNET := MsgBox('{#MyAppVerName} requires the .NET 2.0 Framework. Please download and install the .NET 2.0 Framework and run this setup again. Do you want to download the framwork now?',
  88. mbConfirmation, MB_YESNO) = idYes;
  89. if ResultNET = false then
  90. begin
  91. Result := false;
  92. end
  93. else
  94. begin
  95. Result := false;
  96. ShellExec('open', 'http://download.microsoft.com/download/5/6/7/567758a3-759e-473e-bf8f-52154438565a/dotnetfx.exe','','',SW_SHOWNORMAL,ewNoWait,ErrorCode);
  97. end;
  98. end;
  99. //TODO: Check for GTK#
  100. // Check that SuperTux is installed
  101. SuperTuxPath := GetPathInstalled(SuperTuxID);
  102. if (Length(SuperTuxPath) = 0) then
  103. begin
  104. ResultSuperTux := MsgBox('{#MyAppVerName} requires SuperTux 0.4 to be installed. Are you sure you want to continue without installing SuperTux-0.3?',
  105. mbConfirmation, MB_YESNO) = idYes;
  106. if ResultSuperTux = false then
  107. Result := false;
  108. end;
  109. end;