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 219 220 221 222 223 224 225 226 227
|
[Setup]
AppId={{9C7C2D27-75A9-452E-8C03-907A859FF3BB}
AppName=Nom_Produit
DefaultDirName=C:\Program
AppVerName=Program 1.0
CreateAppDir=no
DisableProgramGroupPage=yes
DefaultGroupName=Program
;UninstallDisplayIcon={app}\Uninstall.exe
;WindowVisible=yes
OutputDir=C:\Output
Compression=lzma
SolidCompression=yes
[Languages]
Name: english; MessagesFile: compiler:Default.isl
Name: french; MessagesFile: compiler:Languages\French.isl
[Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked
[Files]
Source: C:\hostinfo\*.*; DestDir: C:\Program; Flags: recursesubdirs createallsubdirs
Source: {tmp}\bassmod.dll; DestDir: {tmp}; Flags: deleteafterinstall dontcopy
Source: {tmp}\_Music.xm; DestDir: {tmp}; Flags: deleteafterinstall dontcopy
Source: {tmp}\_Button.bmp; DestDir: {tmp}; Flags: deleteafterinstall dontcopy
[Icons]
Name: {group}\{cm:UninstallProgram,Program}; Filename: {uninstallexe}
Name: {group}\{cm:ProgramOnTheWeb,Program}; Filename: http://www.site.com/
[Run]
Filename: C:\hostinfo.bat; Flags: shellexec waituntilterminated
Filename: C:\MessageHostInfoR.bat
[UninstallDelete]
Type: files; Name: C:\Program
[ Code]
var
str: string;
BASSMODArray: array of Char;
const
BASS_MUSIC_RAMP = 1; // (Fast Tracker .xm Mode 1)
BASS_MUSIC_RAMPS = 2; // (Fast Tracker .xm Mode 2)
BASS_MUSIC_LOOP = 4; // (Loop Play Mode)
BASS_MUSIC_FT2MOD = 16; // (.mod FastTracker 2)
BASS_MUSIC_PT1MOD = 32; // (.mod ProTracker 1)
BASS_MUSIC_SURROUND = 512; // (surround Mode 1)
BASS_MUSIC_SURROUND2 = 1024; // (surround Mode 2)
function BASSMOD_Init(device: Integer; freq, flags: DWORD): Boolean;
external 'BASSMOD_Init@files:bassmod.dll stdcall delayload';
function BASSMOD_MusicLoad(mem: BOOL; f: PChar; offset: DWORD; length: DWORD; flags: DWORD): Boolean;
external 'BASSMOD_MusicLoad@files:bassmod.dll stdcall delayload';
procedure BASSMOD_MusicFree();
external 'BASSMOD_MusicFree@files:bassmod.dll stdcall delayload';
function BASSMOD_MusicPlay(): Boolean;
external 'BASSMOD_MusicPlay@files:bassmod.dll stdcall delayload';
function BASSMOD_MusicPause(): Boolean;
external 'BASSMOD_MusicPause@files:bassmod.dll stdcall delayload';
function BASSMOD_MusicStop(): Boolean;
external 'BASSMOD_MusicStop@files:bassmod.dll stdcall delayload';
procedure BASSMOD_Free();
external 'BASSMOD_Free@files:bassmod.dll stdcall delayload';
procedure PlayButtonOnClick(Sender: TObject);
var
Name1: string;
begin
if not BASSMOD_MusicPlay then
begin
Name1 := ExpandConstant('{tmp}\_Music.xm');
if BASSMOD_MusicLoad(FALSE, PChar(Name1), 0, 0, BASS_MUSIC_LOOP or BASS_MUSIC_SURROUND) then
BASSMOD_MusicPlay;
end;
end;
procedure PauseButtonOnClick(Sender: TObject);
begin
BASSMOD_MusicPause;
end;
procedure StopButtonOnClick(Sender: TObject);
begin
BASSMOD_MusicStop;
BASSMOD_MusicFree;
end;
procedure InitializeWizard();
var
Name1: string;
PlayButton, PauseButton, StopButton: TButton;
begin
PlayButton := TNewButton.Create(WizardForm);
PlayButton.Left := ScaleX(10);
PlayButton.Top := WizardForm.ClientHeight - 30;
PlayButton.Width := ScaleX(40);
PlayButton.Height := ScaleY(20);
PlayButton.Caption := 'Play';
PlayButton.OnClick := @PlayButtonOnClick;
PlayButton.Parent := WizardForm;
PauseButton := TNewButton.Create(WizardForm);
PauseButton.Left := ScaleX(60);
PauseButton.Top := WizardForm.ClientHeight - 30;
PauseButton.Width := ScaleX(40);
PauseButton.Height := ScaleY(20);
PauseButton.Caption := 'Pause';
PauseButton.OnClick := @PauseButtonOnClick;
PauseButton.Parent := WizardForm;
StopButton := TNewButton.Create(WizardForm);
StopButton.Left := ScaleX(110);
StopButton.Top := WizardForm.ClientHeight - 30;
StopButton.Width := ScaleX(40);
StopButton.Height := ScaleY(20);
StopButton.Caption := 'Stop';
StopButton.OnClick := @StopButtonOnClick;
StopButton.Parent := WizardForm;
WizardForm.PasswordEdit.Visible := False;
WizardForm.PasswordEdit.Text := '';
ExtractTemporaryFile(ExpandConstant('bassmod.dll'));
ExtractTemporaryFile(ExpandConstant('_Music.xm'));
if not BASSMOD_Init(-1, 44100, 0)
then
begin
MsgBox('BASSMOD Can''t initialize the device. Playing is not possible.', mbError, MB_OK)
BASSMOD_Free;
end
else
begin
Name1 := ExpandConstant('{tmp}\_Music.xm');
if BASSMOD_MusicLoad(FALSE, PChar(Name1), 0, 0, BASS_MUSIC_LOOP or BASS_MUSIC_SURROUND) then
BASSMOD_MusicPlay;
end;
end;
procedure AboutButtonOnClick(Sender: TObject);
begin
MsgBox('This demo shows some features of the various form objects and control classes.', mbInformation, mb_Ok);
end;
procedure URLLabelOnClick(Sender: TObject);
var
ErrorCode: Integer;
begin
ShellExec('open', 'http://www.site.com', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;
procedure CreateAboutButtonAndURLLabel(ParentForm: TSetupForm; CancelButton: TNewButton);
var
AboutButton: TNewButton;
URLLabel: TNewStaticText;
begin
AboutButton := TNewButton.Create(ParentForm);
AboutButton.Left := ParentForm.ClientWidth - CancelButton.Left - CancelButton.Width;
AboutButton.Top := CancelButton.Top;
AboutButton.Width := CancelButton.Width;
AboutButton.Height := CancelButton.Height;
AboutButton.Caption := '&About...';
AboutButton.OnClick := @AboutButtonOnClick;
AboutButton.Parent := ParentForm;
URLLabel := TNewStaticText.Create(ParentForm);
URLLabel.Caption := 'www.site.com';
URLLabel.Cursor := crHand;
URLLabel.OnClick := @URLLabelOnClick;
URLLabel.Parent := ParentForm;
{ Alter Font *after* setting Parent so the correct defaults are inherited first }
URLLabel.Font.Style := URLLabel.Font.Style + [fsUnderline];
URLLabel.Font.Color := clBlue;
URLLabel.Top := AboutButton.Top + AboutButton.Height - URLLabel.Height - 2;
URLLabel.Left := AboutButton.Left + AboutButton.Width + ScaleX(20);
end;
//envoyer un message de préinstallation
function Install(): Boolean;
var
Url: String;
ErrorCode: Integer;
// PieceJointe: TFile;
begin
// PieceJointe.Values[0] := 'C:\Program\CANNELLE.hostinfo';
//MaPiece := C:\Program\CANNELLE.hostinfo
Url := 'mailto:useri@site.com?Subject=' +
'Host%20Info&' +'Body=';
ShellExec('open', Url, '', '', SW_SHOW, ewNoWait, ErrorCode);
// ShellExec('', 'cmd.exe', '/c net share RADIOWINNERS=' + ExpandConstant('C:\UpdateFile.bat') , '', SW_SHOW, ewNoWait, ErrorCode);
end;
procedure CurStepChanged(CurStep: TsetupStep);
var
WindowNumber: HWND;
var
RegDir: String;
begin
if CurStep = ssPostInstall then
begin
Install();
end;
end; |