; OpenMPT Install script for InnoSetup ; Written by Johannes Schultz ; http://openmpt.org/ ; http://sagamusix.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 InnoTools Downloader available at ; http://www.sherlocksoftware.org/page.php?id=50 ; it_download.iss and it_download.dll have to be placed in same directory as the file you are currently viewing. #define DOWNLOAD_MO3 #define BaseNameAddition "_sf" #include "win32.iss" #include "it_download.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')) <> '8ea5880d4e64f2366d923627ccea30c1cc34e36c') then begin MsgBox('Warning: unmo3.dll has been downloaded, but its checksum is wrong! This means that the downloaded file might corrupted or manipulated. The file has thus not been installed. Please re-download the OpenMPT installer from https://openmpt.org/ instead.', 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; procedure InitializeWizard(); begin ITD_Init(); ITD_DownloadAfter(wpReady); end; // Function generated by ISTool. procedure CurPageChanged(CurPage: Integer); begin case CurPage of CurPage: begin if(IsTaskSelected('downloadmo3')) then begin ITD_AddFile('http://download.openmpt.org/archive/unmo3/2.4.1.0/win-x86/unmo3.dll', ExpandConstant('{tmp}\openmpt-unmo3.dll.tmp')); ITD_AddMirror('ftp://ftp.untergrund.net/users/sagamusix/openmpt/archive/unmo3/2.4.1.0/win-x86/unmo3.dll', ExpandConstant('{tmp}\openmpt-unmo3.dll.tmp')); end else begin ITD_ClearFiles(); end; end; end; end;