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 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245
| ; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "website"
#define MyAppVersion "4.9"
#define MyAppPublisher "website"
#define MyAppURL "http://www.website.com/~website/"
#define MyAppExeName "website_update.exe"
#define MyAppVer GetFileVersion("website\website.exe")
#define MyPassword "fd5rd6HPG541ZSX25V5fnvwoeg980"
#define MyXMLURL "http://www.website.com/patchs/check.php"
[Setup]
AppId={{BA760530-996D-4805-B88E-F4DD8DFEBB00}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
;LicenseFile=C:\Documents and Settings\Administrateur\Bureau\flog sauv\License.txt
;InfoBeforeFile=C:\Documents and Settings\Administrateur\Bureau\flog sauv\License.txt
;InfoAfterFile=C:\Documents and Settings\Administrateur\Bureau\flog sauv\License.txt
OutputDir=Output
OutputBaseFilename=website_setup
SetupIconFile=res\funny.ico
Password={#MyPassword}
Compression=lzma
SolidCompression=true
UserInfoPage=true
VersionInfoCompany={#MyAppName}
VersionInfoDescription={#MyAppName}
VersionInfoProductName={#MyAppName}
VersionInfoVersion={#MyAppVer}
Encryption=yes
WizardImageFile=res\WizModernImage-IS2.bmp
WizardSmallImageFile=res\WizModernSmallImage-IS1.bmp
AllowNoIcons=true
SetupLogging=true
; Les fichiers de license. Reste à traduire: Italien, Espagnol et Allemand
[Languages]
Name: english; MessagesFile: compiler:Default.isl; LicenseFile: res\License-en.txt
Name: french; MessagesFile: compiler:Languages\French.isl; LicenseFile: res\License-fr.txt
Name: german; MessagesFile: compiler:Languages\German.isl; LicenseFile: res\License-de.txt
Name: italian; MessagesFile: compiler:Languages\Italian.isl; LicenseFile: res\License-it.txt
Name: spanish; MessagesFile: compiler:Languages\Spanish.isl; LicenseFile: res\License-es.txt
; Variable des texte traduit. Trad. faite avec Google donc à corriger ;-)
[CustomMessages]
french.DL=Telechargement des principaux fichiers
french.DL_File1=Fichier du Jeu
english.DL=Main files to download
english.DL_File1=Game files
german.DL=Main-Dateien zum Download
german.DL_File1=Game-Dateien
italian.DL=Main file da scaricare
italian.DL_File1=File di Gioco
spanish.DL=Cuerpo de archivos para descargar
spanish.DL_File1=Juego de Archivos
; chek serial
cmSerial=Serial:
french.cmSerial=Serial :
cmBadUserOrSerial=Bad username and/or serial.
french.cmBadUserOrSerial=Mauvais nom d'utilisateur et/ou numéro de série.
[Files]
Source: website\7z.exe; DestDir: {app}; Flags: ignoreversion
Source: website\7z.dll; DestDir: {app}; Flags: ignoreversion
Source: website\{#MyAppExeName}; DestDir: {app}; Flags: ignoreversion
Source: website\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs
[_ISToolDownload]
Source: http://www.website.com/patchs/updates/1.zip; DestDir: {tmp}; DestName: 1.zip; Components: Telechargement\Fichier1
[Components]
Name: Telechargement; Description: {cm:DL}; Types: full
Name: Telechargement\Fichier1; Description: {cm:DL_File1}; Types: full
[Icons]
Name: {group}\{#MyAppName}; Filename: {app}\{#MyAppExeName}
Name: {group}\{cm:ProgramOnTheWeb,website}; Filename: {#MyAppURL}
Name: {commondesktop}\{#MyAppName}; Filename: {app}\{#MyAppExeName}; Tasks: desktopicon
Name: {group}\{cm:UninstallProgram,website}; Filename: {uninstallexe}
[Run]
Filename: {app}\7z.exe; Parameters: x {tmp}\1.zip; Components: Telechargement\Fichier1; Flags: runhidden
Filename: {app}\logiciel_update.exe; Description: {cm:LaunchProgram,logiciel}; Flags: nowait postinstall skipifsilent
[ Code]
// Function generated by ISTool.
function NextButtonClick(CurPage: Integer): Boolean;
begin
Result := istool_download(CurPage);
end;
[ code]
var
MyUserInfoPage: TWizardPage; //page pour mettre user et serial
AlreadyShowMyUserInfoPage: boolean; //necessaire pour passer pageinfo une fois ok
// demande user - serial
//on change l'apparence de la page pour demander un user, serial
//et comme sa sert à rien de réinventer la roue on pompe la page prévu pour.
procedure MakeMyUserInfoPage();
var
innoUserInfoPage: TWizardPage;
begin
innoUserInfoPage := PageFromID(wpUserInfo);
MyUserInfoPage := CreateCustomPage(wpWelcome, innoUserInfoPage.Caption, innoUserInfoPage.Description);
//on affiche la demande de user
WizardForm.UserInfoNameLabel.Parent := MyUserInfoPage.Surface;
WizardForm.UserInfoNameEdit.Parent := MyUserInfoPage.Surface;
//on affiche la demande de serial
WizardForm.UserInfoSerialLabel.Parent := MyUserInfoPage.Surface;
WizardForm.UserInfoSerialLabel.Top := WizardForm.UserInfoOrgLabel.Top;
WizardForm.UserInfoSerialLabel.Visible := True;
WizardForm.UserInfoSerialLabel.Caption := ExpandConstant('{cm:cmSerial}');
WizardForm.UserInfoSerialEdit.Parent := MyUserInfoPage.Surface;
WizardForm.UserInfoSerialEdit.Top := WizardForm.UserInfoOrgEdit.Top;
WizardForm.UserInfoSerialEdit.Visible := True;
end;
function CheckPassword(Password: String): Boolean;
begin
Result := True;
end;
procedure InitializeWizard();
begin
AlreadyShowMyUserInfoPage := False;
MakeMyUserInfoPage;
end;
//verification user - serial
function CheckSerialOnline: boolean;
var
XMLHTTP, XMLDoc, Node: Variant;
begin
Result := False;
if (WizardForm.UserInfoNameEdit.Text = '') or (WizardForm.UserInfoSerialEdit.Text = '') then
Exit;
{ Create the main MSXML COM Automation object }
try
XMLHTTP := CreateOleObject('MSXML2.ServerXMLHTTP');
except
RaiseException('Please install MSXML first.'#13#13'(Error ''' + GetExceptionMessage + ''' occurred)');
end;
{ Send user and md5 serial }
XMLHTTP.Open('POST', '{#MyXMLURL}', False);
XMLHTTP.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
{ user and serial need to be encoded if they have space or special caracters like &
you can make a xml and send it, and load in on server alternatively of encodage}
XMLHTTP.Send('user=' + WizardForm.UserInfoNameEdit.Text + '&serial=' + GetMD5OfString(WizardForm.UserInfoSerialEdit.Text));
{ Load the XML Result }
XMLDoc := CreateOleObject('MSXML2.DOMDocument');
XMLDoc.LoadXML(XMLHTTP.responseText);
if XMLDoc.parseError.errorCode <> 0 then
begin
RaiseException('Error on line ' + IntToStr(XMLDoc.parseError.line) + ', position ' +
IntToStr(XMLDoc.parseError.linepos) + ': ' + XMLDoc.parseError.reason);
end
else
begin
Node := XMLDoc.documentElement.firstChild;
if (Node.nodeName = 'password') and (Node.Text <> '') then
begin
WizardForm.PasswordEdit.Text := Node.Text;
AlreadyShowMyUserInfoPage := True;
Result := True;
end;
end;
end;
function NextButtonClick(CurPageID: Integer): Boolean;
begin
if CurPageID = MyUserInfoPage.ID then
begin
//verif sur serveur distant user, serial et récuperation clé.
if CheckSerialOnline then
Result := True
else
begin
MsgBox(ExpandConstant('{cm:cmBadUserOrSerial}'), mbError, MB_OK);
Result := False
end;
end
else
Result := True;
end;
// cacher page info user serial pour ne plus les changer vu que c'est bon
function ShouldSkipPage(PageID: Integer): Boolean;
begin
if (PageID = MyUserInfoPage.ID) and AlreadyShowMyUserInfoPage then
Result := True
else
Result := False;
end;
// cacher page password mais simuler passage pour que le passe soit enregistrer dans inno
const
BM_CLICK = $00F5;
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpPassword then
begin
PostMessage(WizardForm.NextButton.Handle, BM_CLICK, 0, 0);
end;
end;
[ code]
Procedure URLLabelOnClick(Sender: TObject);
var
ErrorCode: Integer;
begin
ShellExec('open', 'http://www.website.com/~website/', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;
var
URLLabel: TNewStaticText;
begin
URLLabel := TNewStaticText.Create(WizardForm);
URLLabel.Caption := 'www.website.com/~website/';
URLLabel.Cursor := crHand;
URLLabel.OnClick := @URLLabelOnClick;
URLLabel.Parent := WizardForm;
{ 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 := WizardForm.ClientHeight - URLLabel.Height - 15;
URLLabel.Left := ScaleX(20);
end; |
Partager