Try this:
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "NewSampleSetup"
#define MyAppVersion "1.0"
#define MyAppPublisher "Example"
#define MyAppURL "http://www.example.com/"
#define MyAppExeName "BarChartExample2.exe"
[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={{8226770F-1270-434F-B53E-5539E78AD05B}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
OutputDir=C:\Users\sandaa\Desktop
OutputBaseFilename=Setup
Compression=lzma
SolidCompression=yes
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: " {cm:AdditionalIcons}"; Flags: unchecked
[Files]
;Source: "C:\Users\stajyer1\Documents\Visual Studio 2012\Projects\BarChartExample2\BarChartExample2\bin\Debug\BarChartExample2.exe"; DestDir: " {app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram, {#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
[Code]
var
FirstLabel: TLabel;
SecondLabel: TLabel;
ThirdLabel: TLabel;
FourthLabel: TLabel;
ServerNameTextBox: TEdit;
WindowsRadioButton: TRadioButton;
SQLRadioButton: TRadioButton;
txtUserName: TEdit;
txtPassword: TEdit;
function AuthenticateDataPage(Page: TWizardPage): Boolean;
begin
Result :=True;
if ServerNameTextBox.Text <> '' then
begin
if SQLRadioButton.Checked then
begin
if txtUserName.Text ='' then
begin
MsgBox('You should enter user name', mbError, MB_OK);
Result :=False;
end
else
begin
if txtPassword.Text ='' then
begin
MsgBox('You should enter password', mbError, MB_OK);
Result :=False;
end
end
end
end
else
begin
MsgBox('You should enter path to SQL Server Database', mbError, MB_OK);
Result :=False;
end;
end;
function CreateDataPage(PreviousPageId: Integer): Integer;
var
Page: TWizardPage;
begin
Page :=CreateCustomPage(PreviousPageId,'SQL Server Database Setup',
'Choose SQL Server database you will be using (ask your administrator about its parameters');
FirstLabel :=TLabel.Create(Page);
with FirstLabel do
begin
Parent :=Page.Surface;
Caption :='Server Name';
Left :=ScaleX(16);
Top :=ScaleY(0);
Width :=ScaleX(84);
Height :=ScaleY(17);
end;
SecondLabel :=TLabel.Create(Page);
With SecondLabel Do
begin
Parent :=Page.Surface;
Caption :='Enter Path to SQL Server (e.g. .\SQLEXPRESS; DEVSERVER)';
Left :=ScaleX(16);
Top :=ScaleY(56);
Width :=ScaleX(300);
Height :=ScaleY(17);
end;
ThirdLabel :=TLabel.Create(Page);
with ThirdLabel do
begin
Parent :=Page.Surface;
Caption :='User name';
Left :=ScaleX(56);
Top :=ScaleY(136);
Width :=ScaleX(70);
Height :=ScaleY(17);
end;
FourthLabel :=TLabel.Create(Page);
with FourthLabel do
begin
Parent :=Page.Surface;
Caption :='Password';
Left :=ScaleX(56);
Top :=ScaleY(168);
Width :=ScaleX(63);
Height :=ScaleY(17);
end;
ServerNameTextBox :=TEdit.Create(Page);
with ServerNameTextBox do
begin
Parent :=Page.Surface;
Left :=ScaleX(16);
Top :=ScaleY(24);
Width :=ScaleX(257);
Height :=ScaleY(25);
TabOrder :=0;
Text :='';
end;
WindowsRadioButton :=TRadioButton.Create(Page);
with WindowsRadioButton do
begin
Parent :=Page.Surface;
Caption :='Use Windows Authentication';
Left :=ScaleX(16);
Top :=ScaleY(88);
Width :=ScaleX(225);
Height :=ScaleY(17);
Checked :=True;
TabOrder :=1;
TabStop :=True;
end;
SQLRadioButton :=TRadioButton.Create(Page);
with SQLRadioButton do
begin
Parent :=Page.Surface;
Caption :='Use SQL Authentication';
Left :=ScaleX(16);
Top :=ScaleY(112);
Width :=ScaleX(193);
Height :=ScaleY(17);
TabOrder :=2;
end;
txtUserName :=TEdit.Create(Page);
with txtUserName do
begin
Parent :=Page.Surface;
Left :=ScaleX(136);
Top :=ScaleY(136);
Width :=ScaleX(121);
Height :=ScaleY(25);
TabOrder :=3;
Text :='';
end;
txtPassword :=TEdit.Create(Page);
with txtPassword do
begin
Parent :=Page.Surface;
Left :=ScaleX(136);
Top :=ScaleY(168);
Width :=ScaleX(121);
Height :=ScaleY(25);
TabOrder :=4;
PasswordChar :='*';
Text :='';
end;
with Page do
begin
OnNextButtonClick :=@AuthenticateDataPage;
end;
Result :=Page.ID;
end;
procedure InitializeWizard();
begin
CreateDataPage(wpLicense);
end;
The only thing I left out is the custommessages.