Probleme script inno setup

Signaler
Messages postés
3
Date d'inscription
samedi 7 janvier 2006
Statut
Membre
Dernière intervention
4 juin 2009
-
Messages postés
3
Date d'inscription
samedi 7 janvier 2006
Statut
Membre
Dernière intervention
4 juin 2009
-
Bonjour,
je vous expose mon problème.
Il y a une erreur dans le script qui suit qui fait qu'il est impossible de le compiler.
Je souhaiterait savoir si l'un d'entre vous pouvais éclairé ma lanterne en me disant ce qui ne va pas.

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{9F0EADB8-DD8C-44AE-9144-E33F13CD9142}
AppName=Pulse Gaming GUI
AppVerName=Pulse Gaming GUI V1.1
AppPublisher=Lowmach1ne
AppPublisherURL=http://www.pulsegaming.eu
AppSupportURL=http://www.pulsegaming.eu
AppUpdatesURL=http://www.pulsegaming.eu
DefaultDirName={reg:HKCU\Software\Valve\Steam,SteamPath|{pf}\steam}\steamapps\{code:GetDirPath2|Steam}\Counter-Strike Source
DefaultGroupName=Pulse Gaming GUI
DisableProgramGroupPage=yes
LicenseFile=C:\Documents and Settings\Administrateur\Bureau\gpl.txt
InfoBeforeFile=C:\Documents and Settings\Administrateur\Bureau\before.txt
InfoAfterFile=C:\Documents and Settings\Administrateur\Bureau\after.txt
OutputDir=C:\Documents and Settings\Administrateur\Bureau\PulseGaming-gui-v1.1
OutputBaseFilename=setup-Pulsegaming-gui-v1-1-beta
SetupIconFile=C:\Documents and Settings\Administrateur\Bureau\5012.ico
Compression=lzma/max
SolidCompression=yes
PrivilegesRequired=admin
VersionInfoVersion=1.1
VersionInfoCompany=PulseGaming.eu
VersionInfoDescription=Gui pour counter strike source
VersionInfoCopyright=Lowmach1ne
VersionInfoProductName=Lowmach1ne
VersionInfoProductVersion=1.1
AppCopyright=Copyright© 2009 Lowmach1ne

[Languages]
Name: "french"; MessagesFile: "compiler:Languages\French.isl"

[Files]
Source: "{app}\*"; DestDir: "{app}\backup"; Flags: external skipifsourcedoesntexist uninsneveruninstall
Source: "C:\Documents and Settings\Administrateur\Bureau\PulseGaming-gui-v1.1\Counter-Strike Source\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\{cm:ProgramOnTheWeb,Pulse Gaming GUI}"; Filename: "http://www.pulsegaming.eu"
Name: "{group}\{cm:UninstallProgram,Pulse Gaming GUI}"; Filename: "{uninstallexe}"

[Run]
Filename: "{app}\cstrike\prereg.bat"; Description: "{cm:LaunchProgram,Pulse Gaming GUI v1.1}"; Flags: shellexec;

[Code]
Procedure URLLabelOnClick(Sender: TObject);
var
  ErrorCode: Integer;
begin
  ShellExec('open', 'http://www.pulsegaming.eu', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;

var
  UserPage: TInputQueryWizardPage;

procedure CreateTheWizardPages;
begin
  { Create the pages }

  UserPage := CreateInputQueryPage(wpInfoBefore,
    'Login Steam', 'Quel est votre login Steam?',
    'Ce logiciel vous demande votre login steam et non votre password.');
  UserPage.Add('Steam:', False);
  UserPage.Values[0] := GetPreviousData('Steam', '');

end;

procedure RegisterPreviousData(PreviousDataKey: Integer);
var
  UsageMode: String;
begin
  { Store the settings so we can restore them next time }
  SetPreviousData(PreviousDataKey, 'Steam', UserPage.Values[0]);
end;

function NextButtonClick(CurPageID: Integer): Boolean;
var
  I: Integer;
begin
  { Validate certain pages before allowing the user to proceed }
  if CurPageID = UserPage.ID then begin
    if UserPage.Values[0] = '' then begin
      MsgBox('Vous devez entrer votre login steam.', mbError, MB_OK);
      Result := False;
    end else begin
      Result := True;
    end;
  end else
    Result := True;
end;

function UpdateReadyMemo(Space, NewLine, MemoUserInfoInfo, MemoDirInfo, MemoTypeInfo,
  MemoComponentsInfo, MemoGroupInfo, MemoTasksInfo: String): String;
var
  S: String;
begin
  { Fill the 'Ready Memo' with the normal settings and the custom settings }
  S := '';
  S := S + 'Personal Information:' + NewLine;
  S := S + Space + UserPage.Values[0] + NewLine;

  S := S + NewLine + NewLine;

  S := S + MemoDirInfo + NewLine;

  Result := S;
end;

function GetDirPath2(Param: String): String;
begin
  if Param = 'Steam' then
    Result := UserPage.Values[0];
end;

procedure InitializeWizard();
var
  URLLabel: TNewStaticText;
begin
  CreateTheWizardPages;
  URLLabel := TNewStaticText.Create(WizardForm);
  URLLabel.Caption := 'www.pulsegaming.eu';
  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;

3 réponses

Messages postés
4718
Date d'inscription
dimanche 26 février 2006
Statut
Modérateur
Dernière intervention
14 janvier 2021
14
bonjour,
Il y a une erreur dans le script qui suit

Merci d'indiquer où se produit le plantage et quel est le message d'erreur éventuel.

cantador
Messages postés
3
Date d'inscription
samedi 7 janvier 2006
Statut
Membre
Dernière intervention
4 juin 2009

Bonjour j'ai trouvé d'où viens le problème cela viens du faite que la variable UserPage.Values[0] n existe pas encore quand elle a été appelé.

Donc maintenant je cherche un moyen de faire en sorte que temps que la variable  UserPage.Values[0] n'existe pas encore cela la remplace par 'VOTRE COMPT SVP'.

Et l'autre probléme qui va y avoir c'est comment faire pour forcer inno setup a modifier la valeur de DefaultDirName
apres la page UserPage

Cordialement
Messages postés
3
Date d'inscription
samedi 7 janvier 2006
Statut
Membre
Dernière intervention
4 juin 2009

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{9F0EADB8-DD8C-44AE-9144-E33F13CD9142}
AppName=Pulse Gaming GUI {code:GetDirPath2}
AppVerName=Pulse Gaming GUI V1.1
AppPublisher=Lowmach1ne
AppPublisherURL=http://www.pulsegaming.eu
AppSupportURL=http://www.pulsegaming.eu
AppUpdatesURL=http://www.pulsegaming.eu
DefaultDirName={reg:HKCU\Software\Valve\Steam,SteamPath|{pf}\steam}\steamapps\{code:GetDirPath2}\Counter-Strike Source
DefaultGroupName=Pulse Gaming GUI
DisableProgramGroupPage=yes
LicenseFile=C:\Documents and Settings\Administrateur\Bureau\gpl.txt
InfoBeforeFile=C:\Documents and Settings\Administrateur\Bureau\before.txt
InfoAfterFile=C:\Documents and Settings\Administrateur\Bureau\after.txt
OutputDir=C:\Documents and Settings\Administrateur\Bureau\PulseGaming-gui-v1.1
OutputBaseFilename=setup-Pulsegaming-gui-v1-1-beta
SetupIconFile=C:\Documents and Settings\Administrateur\Bureau\5012.ico
Compression=bzip
SolidCompression=yes
PrivilegesRequired=admin
VersionInfoVersion=1.1
VersionInfoCompany=PulseGaming.eu
VersionInfoDescription=Gui pour counter strike source
VersionInfoCopyright=Lowmach1ne
VersionInfoProductName=Lowmach1ne
VersionInfoProductVersion=1.1
AppCopyright=Copyright© 2009 Lowmach1ne
ChangesEnvironment=yes
UsePreviousAppDir=no

[Languages]
Name: "french"; MessagesFile: "compiler:Languages\French.isl"

[Files]
Source: "{app}\*"; DestDir: "{app}\backup"; Flags: external skipifsourcedoesntexist uninsneveruninstall
Source: "C:\Documents and Settings\Administrateur\Bureau\PulseGaming-gui-v1.1\Counter-Strike Source\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\{cm:ProgramOnTheWeb,Pulse Gaming GUI}"; Filename: "http://www.pulsegaming.eu"
Name: "{group}\{cm:UninstallProgram,Pulse Gaming GUI}"; Filename: "{uninstallexe}"

[Run]
Filename: "{app}\cstrike\prereg.bat"; Description: "{cm:LaunchProgram,Pulse Gaming GUI v1.1}"; Flags: shellexec;

[Tasks]

Procedure URLLabelOnClick(Sender: TObject);
var
  ErrorCode: Integer;
begin
  ShellExec('open', 'http://www.pulsegaming.eu', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;

var
  UserPage: TInputQueryWizardPage;

procedure CreateTheWizardPages;
begin
  { Create the pages }

  UserPage := CreateInputQueryPage(wpInfoBefore,
    'Login Steam', 'Quel est votre login Steam?',
    'Ce logiciel vous demande votre login steam et non votre password.');
  UserPage.Add('Steam:', False);
  UserPage.Values[0] := GetPreviousData('Steam', '');

end;

procedure RegisterPreviousData(PreviousDataKey: Integer);
var
  UsageMode: String;
begin
  { Store the settings so we can restore them next time }
  SetPreviousData(PreviousDataKey, 'Steam', UserPage.Values[0]);
end;

function NextButtonClick(CurPageID: Integer): Boolean;
var
  I: Integer;
begin
  { Validate certain pages before allowing the user to proceed }
  if CurPageID = UserPage.ID then begin
    if UserPage.Values[0] = '' then begin
      MsgBox('Vous devez entrer votre login steam.', mbError, MB_OK);
      Result := False;
    end else begin
      Result := True;
    end;
  end else
    Result := True;
end;

function UpdateReadyMemo(Space, NewLine, MemoUserInfoInfo, MemoDirInfo, MemoTypeInfo,
  MemoComponentsInfo, MemoGroupInfo, MemoTasksInfo: String): String;
var
  S: String;
begin
  { Fill the 'Ready Memo' with the normal settings and the custom settings }
  S := '';
  S := S + 'Votre Login Steam:' + NewLine;
  S := S + Space + UserPage.Values[0] + NewLine;

  S := S + NewLine + NewLine;

  S := S + MemoDirInfo + NewLine;

  Result := S;
end;

{function GetDirPath2(Param: String): String;
begin
  if Param = 'Steam' then
    Result := UserPage.Values[0];
end;}

function GetDirPath2(Param: String): String;
begin
  // Pointer variables are not set to nil by default
  if Assigned(UserPage)
  then Result := UserPage.Values[0]
  else Result := 'Votre Login';
end;

procedure InitializeWizard();
var
  URLLabel: TNewStaticText;
begin
  CreateTheWizardPages;
  URLLabel := TNewStaticText.Create(WizardForm);
  URLLabel.Caption := 'www.pulsegaming.eu';
  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;


Ceci est ma dernière version, il ne me reste plus que a faire en sorte que la valeur DefaultDirName soit modifier apres la page UserPage

Merci