1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218
| // NOTE: Scrip de Survivor: Diaporama + musique + Background + Images en dessous de la barre d'installation
#define MyAppName "Titre du Jeu"
#define MyAppVersion "Version du jeu"
#define MyAppPublisher "Up By Survivor"
#define MyAppURL "http://censuré.ws/"
#define MyAppExeName "MyProg.exe"
[Setup]
AppId={{A224C59F-D047-42E3-B45C-99EA43DC9A23}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
InfoAfterFile=D:\Utilisateur\Desktop\Informations.txt
OutputDir=D:\Utilisateur\Desktop
OutputBaseFilename=Titre du Jeu
SetupIconFile=C:\Program Files (x86)\ExtracteurIcones31\Sauve\Beatbuddy.ico
Compression=lzma
SolidCompression=yes
WindowVisible=yes
[Code/]
// Image intégrer en dessous de la barre d'installation
var
ImgInstall: TBitmapImage;
procedure InitializeWizard();
var
ImgInstallFile: String;
begin
ImgInstallFile := ExpandConstant('{tmp}\instal.bmp');
ExtractTemporaryFile(ExtractFileName(ImgInstallFile));
ImgInstall := TBitmapImage.Create(WizardForm.InstallingPage);
ImgInstall.AutoSize := True;
ImgInstall.Top := 50;
ImgInstall.Left := 0;
ImgInstall.Bitmap.LoadFromFile(ImgInstallFile);
ImgInstall.Parent := WizardForm.InstallingPage;
end;
// Diaporama + Musique
// Partie musique
var
TimerID: Integer;
SlideID: Integer;
BackImage: TBitmapImage;
const
EC_COMPLETE = $01;
type
TTimerProc = procedure(Wnd: HWND; Msg: UINT; TimerID: UINT_PTR;
SysTime: DWORD);
TDirectShowEventProc = procedure(EventCode, Param1, Param2: Integer);
function WrapTimerProc(Callback: TTimerProc; ParamCount: Integer): LongWord;
external 'wrapcallback@files:InnoCallback.dll stdcall';
function SetTimer(hWnd: HWND; nIDEvent, uElapse: UINT;
lpTimerFunc: UINT): UINT; external 'SetTimer@user32.dll stdcall';
function KillTimer(hWnd: HWND; uIDEvent: UINT): BOOL;
external 'KillTimer@user32.dll stdcall';
function DSGetLastError(var ErrorText: WideString): HRESULT;
external 'DSGetLastError@files:mediaplayer.dll stdcall';
function DSPlayMediaFile: Boolean;
external 'DSPlayMediaFile@files:mediaplayer.dll stdcall';
function DSStopMediaPlay: Boolean;
external 'DSStopMediaPlay@files:mediaplayer.dll stdcall';
function DSSetVolume(Value: LongInt): Boolean;
external 'DSSetVolume@files:mediaplayer.dll stdcall';
function DSInitializeAudioFile(FileName: WideString;
CallbackProc: TDirectShowEventProc): Boolean;
external 'DSInitializeAudioFile@files:mediaplayer.dll stdcall';
procedure OnMediaPlayerEvent(EventCode, Param1, Param2: Integer);
begin
if EventCode = EC_COMPLETE then
begin
if DSInitializeAudioFile(ExpandConstant('{tmp}\AudioFile.mp3'),
@OnMediaPlayerEvent) then
begin
DSSetVolume(-2500);
DSPlayMediaFile;
end;
end;
end;
// Partie diaporama
procedure OnSlideTimer(Wnd: HWND; Msg: UINT; TimerID: UINT_PTR;
SysTime: DWORD);
begin
case SlideID of
0: SlideID := 1;
1: SlideID := 0;
end;
BackImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Image' + IntToStr(SlideID + 1) + '.bmp'));
end;
procedure StartSlideTimer;
var
TimerCallback: LongWord;
begin
TimerCallback := WrapTimerProc(@OnSlideTimer, 4);
// third parameter here is the timer's timeout value in milliseconds
TimerID := SetTimer(0, 0, 5000, TimerCallback);
end;
procedure KillSlideTimer;
begin
if TimerID <> 0 then
begin
if KillTimer(0, TimerID) then
TimerID := 0;
end;
end;
procedure InitializeWizard;
var
ErrorCode: HRESULT;
ErrorText: WideString;
begin
TimerID := 0;
SlideID := 0;
ExtractTemporaryFile('Imagegauchehaut1.bmp');
ExtractTemporaryFile('Imagegauchehaut2.bmp');
BackImage := TBitmapImage.Create(MainForm);
BackImage.Parent := MainForm;
BackImage.Top := 70;
BackImage.Left := 10;
BackImage.AutoSize := True;
BackImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Image1.bmp'));
StartSlideTimer;
ExtractTemporaryFile('AudioFile.mp3');
if DSInitializeAudioFile(ExpandConstant('{tmp}\AudioFile.mp3'),
@OnMediaPlayerEvent) then
begin
DSSetVolume(-2500);
DSPlayMediaFile;
end
else
begin
ErrorCode := DSGetLastError(ErrorText);
MsgBox('TDirectShowPlayer error: ' + IntToStr(ErrorCode) + '; ' +
ErrorText, mbError, MB_OK);
end;
end;
procedure DeinitializeSetup;
begin
KillSlideTimer;
DSStopMediaPlay;
end;
// Changement du Background par défaut par une image qui s'autosize
var
WallPaper: TBitmapImage;
procedure InitializeWizard();
begin
ExtractTemporaryFile('Background.bmp');
WallPaper := TBitmapImage.Create(MainForm);
WallPaper.Bitmap.LoadFromFile(ExpandConstant('{tmp}') + 'Background.bmp');
WallPaper.Left := 0;
WallPaper.Top := 0;
WallPaper.Width := MainForm.Width;
WallPaper.Height := MainForm.Height;
WallPaper.Stretch := True;
WallPaper.Parent := MainForm;
end;
[Languages]
Name: "french"; MessagesFile: "compiler:Languages\French.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[dirs]
Name: "{app}\je veux un dossier\";
Name: "{app}\et encore un\";
[Files]
// Note: Fichiers du programme
Source: "D:\Program Files\Inno Setup 5\Examples\MyProg.exe"; DestDir: "{app}"; Flags: ignoreversion
// NOTE: Images en dessous de la barre d'installation
Source: "\Images installateurs\instal.bmp"; Flags: dontcopy deleteafterinstall
// NOTE: Fichiers (Images) du diaporama
Source: "D:\Utilisateur\Desktop\Images installateurs\Imagegauchehaut1.bmp"; Flags: dontcopy
Source: "D:\Utilisateur\Desktop\Images installateurs\Imagegauchehaut2.bmp"; Flags: dontcopy
Source: "D:\Utilisateur\Desktop\Images installateurs\Imagegauchebas1.bmp"; Flags: dontcopy
Source: "D:\Utilisateur\Desktop\Images installateurs\Imagegauchebas2.bmp"; Flags: dontcopy
Source: "D:\Utilisateur\Desktop\Images installateurs\Imagedroitehaut1.bmp"; Flags: dontcopy
Source: "D:\Utilisateur\Desktop\Images installateurs\Imagedroitehaut2.bmp"; Flags: dontcopy
// NOTE: Fichiers obligatoire à intégrer pour l'utilisation d'une musique + diaporama
Source: "D:\Utilisateur\Desktop\Images installateurs\AudioFile.mp3"; Flags: dontcopy
Source: "D:\Utilisateur\Desktop\Images installateurs\MediaPlayer.dll"; Flags: dontcopy
Source: "D:\Utilisateur\Desktop\Images installateurs\InnoCallback.dll"; Flags: dontcopy
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent |
Partager