-
Notifications
You must be signed in to change notification settings - Fork 8
/
example2.iss
67 lines (57 loc) · 2.04 KB
/
example2.iss
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
#define MyAppName "My Program"
#define MyAppVerName "My Program 1.5"
#define MyAppPublisher "My Company, Inc."
#define MyAppURL "http://www.mycompany.com"
[Setup]
AppName={#MyAppName}
AppVerName={#MyAppVerName}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputBaseFilename=example2
Compression=lzma
SolidCompression=true
CreateAppDir=true
ShowLanguageDialog=yes
[Languages]
Name: english; MessagesFile: compiler:Default.isl
#include ReadReg(HKEY_LOCAL_MACHINE,'Software\Sherlock Software\InnoTools\Downloader','ScriptPath','');
[Code]
{ This is a demo of ITD's ability to POST data to a webpage. This allows you to do things like
collect feedback from users during install
}
var
inputpage:TInputQueryWizardPage;
procedure InitializeWizard();
var response:string;
begin
itd_init;
inputpage:=CreateInputQueryPage(wpWelcome, 'Post data', 'To test ITD''s posting functionality','Enter a string in the box below to send to the server');
inputpage.add('String to send:', false);
end;
function NextButtonClick(CurPageID: Integer): Boolean;
var
response:String;
begin
result:=true;
if CurPageID=inputpage.id then begin
{ The PHP script we post our data to is a simple one which just echos back the
posted data, along with a little message. (It also escapes HTML characters
so that it cannot be used in a XSS attack against my website.).
For reference, here's the PHP script that receives the post and replies:
<?PHP
global $HTTP_RAW_POST_DATA;
echo "You sent this data to me:\r\n".htmlentities($HTTP_RAW_POST_DATA);
?>
}
if itd_postpage('http://www.sherlocksoftware.org/innotools/posttest.php', inputpage.values[0], response) then begin
MsgBox('The server replies:'#13#10+response, mbInformation, MB_OK);
end else begin
MsgBox('Couldn''t post data to server', mbError, MB_OK);
result:=false;
end;
end;
end;