|
From: <sag...@us...> - 2010-07-12 23:10:19
|
Revision: 642
http://modplug.svn.sourceforge.net/modplug/?rev=642&view=rev
Author: saga-games
Date: 2010-07-12 22:45:33 +0000 (Mon, 12 Jul 2010)
Log Message:
-----------
[Imp] Installer: Better separation between "normal" setup and "unmo3-free" setup (code-wise). There's no need to change files during setup compilation anymore, just compile install.iss with regular InnoSetup+ISPP for a "normal" setup and compile "install-unmo3-free.iss" with ISTool for an "unmo3-free" setup.
Modified Paths:
--------------
trunk/OpenMPT/installer/install.iss
Added Paths:
-----------
trunk/OpenMPT/installer/install-unmo3-free.iss
Added: trunk/OpenMPT/installer/install-unmo3-free.iss
===================================================================
--- trunk/OpenMPT/installer/install-unmo3-free.iss (rev 0)
+++ trunk/OpenMPT/installer/install-unmo3-free.iss 2010-07-12 22:45:33 UTC (rev 642)
@@ -0,0 +1,40 @@
+; OpenMPT Install script for InnoSetup
+; Written by Johannes Schultz
+; http://sagamusix.de/
+; http://sagagames.de/
+
+; This file is provided for creating an install package without the proprietary unmo3.dll (for example for the SourceForge package).
+; Instead of including the file in the setup package, the user instead has the possibility to automatically download unmo3.dll from
+; our servers.
+; The download code requires the ISTool IDE with its downloader extension. ISPP is also required.
+; To download and install ISPP and ISTool, get the Inno Setup QuickStart Pack from http://www.jrsoftware.org/isdl.php#qsp
+
+#define DOWNLOAD_MO3
+
+#include "install.iss"
+
+[Code]
+// Verify checksum of downloaded file, and if it is OK, copy it to the app directory.
+procedure VerifyUNMO3Checksum();
+begin
+ if(IsTaskSelected('downloadmo3') And FileExists(ExpandConstant('{tmp}\openmpt-unmo3.dll.tmp'))) then
+ begin
+ if(GetSHA1OfFile(ExpandConstant('{tmp}\openmpt-unmo3.dll.tmp')) <> '2e17f7bb6d19ce326851333b918070c5357cacd1') then
+ begin
+ MsgBox('Warning: unmo3.dll has been downloaded, but its checksum is wrong! This means that either the downloaded file is corrupted or that a newer version of unmo3.dll is available. The file has thus not been installed. Please obtain unmo3.dll from http://openmpt.com/ and verify its checksum.', mbCriticalError, MB_OK)
+ end else
+ begin
+ FileCopy(ExpandConstant('{tmp}\openmpt-unmo3.dll.tmp'), ExpandConstant('{app}\unmo3.dll'), true);
+ end;
+ DeleteFile(ExpandConstant('{tmp}\openmpt-unmo3.dll.tmp'));
+ end;
+end;
+
+// Function generated by ISTool.
+function NextButtonClick(CurPage: Integer): Boolean;
+begin
+ Result := istool_download(CurPage);
+end;
+
+[_ISToolDownload]
+Source: http://openmpt.com/download/unmo3.dll; DestDir: {tmp}; DestName: openmpt-unmo3.dll.tmp; Tasks: downloadmo3
Modified: trunk/OpenMPT/installer/install.iss
===================================================================
--- trunk/OpenMPT/installer/install.iss 2010-07-10 23:19:27 UTC (rev 641)
+++ trunk/OpenMPT/installer/install.iss 2010-07-12 22:45:33 UTC (rev 642)
@@ -5,11 +5,9 @@
; ISPP is needed for automated version retrieval.
; Furthermore, the ISTool IDE with its downloader extension is required for "unmo3-free" packages which don't contain unmo3.dll, but download it from a server.
+; Check install-unmo3-free.iss for details on this matter.
; To download and install ISPP and ISTool, get the Inno Setup QuickStart Pack from http://www.jrsoftware.org/isdl.php#qsp
-; Use this for sourceforge.net packages (ISTool required):
-;#define DOWNLOAD_MO3
-
#define GetAppVersion StringChange(GetFileProductVersion("..\mptrack\bin\mptrack.exe"), ",", ".")
#define GetAppVersionShort Copy(GetAppVersion, 1, 4)
@@ -129,6 +127,10 @@
[Code]
+#ifdef DOWNLOAD_MO3
+procedure VerifyUNMO3Checksum(); forward;
+#endif
+
// Copy old config files to the AppData directory, if there are any (and if the files don't exist already)
procedure CopyConfigsToAppDataDir();
var
@@ -185,18 +187,7 @@
begin
#ifdef DOWNLOAD_MO3
- // Verify checksum of downloaded file, and if it is OK, copy it to the app directory.
- if(IsTaskSelected('downloadmo3') And FileExists(ExpandConstant('{tmp}\openmpt-unmo3.dll.tmp'))) then
- begin
- if(GetSHA1OfFile(ExpandConstant('{tmp}\openmpt-unmo3.dll.tmp')) <> '2e17f7bb6d19ce326851333b918070c5357cacd1') then
- begin
- MsgBox('Warning: unmo3.dll has been downloaded, but its checksum is wrong! This means that either the downloaded file is corrupted or that a newer version of unmo3.dll is available. The file has thus not been installed. Please obtain unmo3.dll from http://openmpt.com/ and verify its checksum.', mbCriticalError, MB_OK)
- end else
- begin
- FileCopy(ExpandConstant('{tmp}\openmpt-unmo3.dll.tmp'), ExpandConstant('{app}\unmo3.dll'), true);
- end;
- DeleteFile(ExpandConstant('{tmp}\openmpt-unmo3.dll.tmp'));
- end;
+ VerifyUNMO3Checksum();
#endif
// Copy old config files from app's directory, if possible and necessary.
@@ -279,12 +270,4 @@
end;
end;
end;
-#ifdef DOWNLOAD_MO3
-// Function generated by ISTool.
-function NextButtonClick(CurPage: Integer): Boolean;
-begin
- Result := istool_download(CurPage);
-end;
-[_ISToolDownload]
-Source: http://openmpt.com/download/unmo3.dll; DestDir: {tmp}; DestName: openmpt-unmo3.dll.tmp; Tasks: downloadmo3
-#endif
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|