Bonjour,

Je débute sur Innosetup et je bloque sur une chose.

Mon installeur à pour but de configurer un fichier xml en fonction des infos entrées par l'utilisateur (je pars d'un fichier iss existant)

Auparavant il fallait renseigner un proxy quoiqu'il arrive
J'aimerais maintenant ajouter la possibilité de choisir s'il y a un proxy ou non (donc une ligne à ajouter ou non dans mon fichier xml)

J'ai donc crée une page qui permet de cocher "oui" ou "non", mais peut importe ce que l'on coche la page du proxy ne s'affiche pas...

J'ai l'impression que ma variable "Proxy" reste à False car quand je remplace la ligne "if (Proxy = True)" par "if (Proxy = False)" j'ai bien la page des infos proxy.

Avez-vous une idée ?

Merci

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
246
247
248
249
250
251
252
253
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
 
#define MyAppName "GROUPE Blablabla"
#define MyAppVersion "2016.01.27"
#define MyAppPublisher "GROUPE"
#define MyAppURL "http://www.blabla.fr/"
 
[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={{E0AFA35C-0653-4FB5-9A0B-A6A852DD7BF3}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
CreateAppDir=no
OutputBaseFilename={#MyAppName} - {#MyAppVersion}
Compression=lzma2/ultra
;Compression=none 
SolidCompression=yes
PrivilegesRequired=poweruser
SetupLogging=yes
AllowNoIcons=yes
DisableProgramGroupPage=yes
;SetupIconFile=icones\JurisWeb.ico
UninstallFilesDir={tmp}\uninst      
;WizardImageFile=icones\office.bmp
;WizardSmallImageFile=icones\office.bmp
 
[Languages]
Name: "french"; MessagesFile: "compiler:Languages\French.isl"
 
Code]
 
var
  PageParam: TInputDirWizardPage;
  Pageproxy: TInputQueryWizardPage;
  PageClient: TInputQueryWizardPage;
  Page: TWizardPage;
  CaseProxy: TNewCheckListBox;
  Proxy: Boolean;
 
 
function GetDir(Param: String): String;
begin
  Result := PageParam.Values[StrToInt(Param)];                     
end;
 
function authentication_form_NextButtonClick(Page: TWizardPage): Boolean;
begin
  Result := True;
 
  if DirExists(PageParam.Values[0]) then
  begin
    MsgBox('Attention le répertoire '+PageParam.Values[0]+' existe déja.', mbError, MB_OK);
    Result := False;
  end;
 
    if DirExists(PageParam.Values[1]) then
  begin
    MsgBox('Attention le répertoire '+PageParam.Values[1]+' existe déja.', mbError, MB_OK);
    Result := False;
  end;
 
end;
 
 
 
function CheckProxy_form_NextButtonClick(Page: TWizardPage): Boolean;
begin
  Result := True;
  Proxy := True;
 
      if (CaseProxy.Checked[0] = True) then
  begin
    Proxy := True;
  end;
 
    if (CaseProxy.Checked[1] = True) then
  begin
    Proxy := False;
  end;
 
end;
 
 
 
procedure fussxml();
var Resultat : Boolean;
begin
    Resultat := SaveStringToFile(ExpandConstant('{code:GetDir|0}\fuss.xml'), '<?xml version="1.0" encoding="UTF-8"?>' + #13#10, False);
 
    if (Resultat = True) then
    begin
      Resultat := SaveStringToFile(ExpandConstant('{code:GetDir|0}\fuss.xml'), '<config>' + #13#10, True);
    end;
 
    if (Resultat = True) then
    begin
      Resultat := SaveStringToFile(ExpandConstant('{code:GetDir|0}\fuss.xml'), '	<serveur>https://test.fr/server/</serveur>' + #13#10, True);
    end; 
 
    if (Resultat = True) then
    begin
        Resultat := SaveStringToFile(ExpandConstant('{code:GetDir|0}\fuss.xml'), '	<proxy serveur="' + Pageproxy.Values[0] + '" port="' + Pageproxy.Values[1] + '" user="' + Pageproxy.Values[2] + '" password="' + Pageproxy.Values[3]+ '" />' + #13#10, True);
    end;
 
    if (Resultat = True) then
    begin
        Resultat := SaveStringToFile(ExpandConstant('{code:GetDir|0}\fuss.xml'), '		<application description="' + Pageclient.Values[0] + '">' + #13#10, True);
    end;
 
    if (Resultat = True) then
    begin
        Resultat := SaveStringToFile(ExpandConstant('{code:GetDir|0}\fuss.xml'), '                <nom>client</nom>' + #13#10, True);
    end;
 
    if (Resultat = True) then
    begin
        Resultat := SaveStringToFile(ExpandConstant('{code:GetDir|0}\fuss.xml'), '                <branche>stable</branche>' + #13#10, True);
    end;
    if (Resultat = True) then
    begin
        Resultat := SaveStringToFile(ExpandConstant('{code:GetDir|0}\fuss.xml'), '                <version>1.2.10</version>' + #13#10, True);
    end;
 
    if (Resultat = True) then
    begin
        Resultat := SaveStringToFile(ExpandConstant('{code:GetDir|0}\fuss.xml'), '                <chemin>' + PageParam.Values[0] + '</chemin>' + #13#10, True);
    end;
 
    if (Resultat = True) then
    begin
        Resultat := SaveStringToFile(ExpandConstant('{code:GetDir|0}\fuss.xml'), '                <serveurService>Client</serveurService>' + #13#10, True);
    end;
 
    if (Resultat = True) then
    begin
        Resultat := SaveStringToFile(ExpandConstant('{code:GetDir|0}\fuss.xml'), '	    </application>' + #13#10, True);
    end;
 
    if (Resultat = True) then
    begin
        Resultat := SaveStringToFile(ExpandConstant('{code:GetDir|0}\fuss.xml'), '</config>' + #13#10, True);
    end;
 
    MsgBox('Merci de placer les certficats dans le répertoire : '+PageParam.Values[0]+'.', mbError, MB_OK);
 
end;
 
 
procedure CreateTheWizardPages;
begin
  PageParam := CreateInputDirPage(wpWelcome,'Répertoire d''installation','Test',
		'Sélectionnez le répertoire d''installation',
		False, 'New Folder');
 
	// Ajouter un élément (avec une valeur vide)
	PageParam.Add('Répertoire du logiciel');
  PageParam.Add('Test');
 
	// Initialiser les valeurs par défaut (optional)
	PageParam.Values[0] := 'D:\client';
  PageParam.Values[1] := 'D:\Test';
 
  with PageParam do
  begin
    OnNextButtonClick := @authentication_form_NextButtonClick;
  end;
 
 
end;
 
procedure CreateTheProxyPages;
begin
  Page := CreateCustomPage(wpWelcome, 'Proxy', 'Oui ou non');
 
  CaseProxy := TNewCheckListBox.Create(Page);
  CaseProxy.Width := Page.SurfaceWidth;
  CaseProxy.Height := ScaleY(97);
  CaseProxy.MinItemHeight := WizardForm.TasksList.MinItemHeight;
  CaseProxy.Flat := True;
  CaseProxy.Parent := Page.Surface;
  CaseProxy.ShowLines := False;
  CaseProxy.WantTabs := True;
  CaseProxy.BorderStyle := bsNone;
  CaseProxy.ParentColor := True;
  CaseProxy.AddRadioButton('Oui', '', 0, True, True, nil);
  CaseProxy.AddRadioButton('Non', '', 0, False, True, nil);
 
 
      with Page do
  begin
    OnNextButtonClick := @CheckProxy_form_NextButtonClick;
  end;
 
 
end;
 
 
procedure CreateTheParamProxyPages;
begin
 
 
if (Proxy = True) then
begin
  Pageproxy := CreateInputQueryPage(wpWelcome,
  'Configuration du Proxy', 'Merci de remplir les renseignements du proxy.','');
 
 
      // Add items (False means it's not a password edit)
      Pageproxy.Add('proxy :', False);
      Pageproxy.Add('port :', False);
      Pageproxy.Add('utilisateur :', False);
      Pageproxy.Add('Mot de passe :', True);
 
      // Set initial values (optional)
      Pageproxy.Values[0] := 'proxy.fr';
      Pageproxy.Values[1] := '8080';
      Pageproxy.Values[2] := 'utilisateur';
      Pageproxy.Values[3] := 'password';
end;  
 
end;
 
procedure CreateClient;
begin
  Pageclient := CreateInputQueryPage(wpWelcome,
  'Information sur le client', 'Merci de remplir les renseignements du client',
  '');
 
  // Add items (False means it's not a password edit)
  Pageclient.Add('N° Client)', False);
 
  // Set initial values (optional)
  Pageclient.Values[0] := '99999';
end;
 
 
 
procedure InitializeWizard();
begin
  CreateClient;
  CreateTheParamProxyPages;
  CreateTheProxyPages;
  CreateTheWizardPages;
 
end;