PDA

View Full Version : How to add web url in innosetup?


jitender
24-02-2018, 09:13
hello i am using istool to making setup.But i don't know how to add my web url at bottom left corner of my setup.Please help me.See image: https://s9.postimg.org/4y8doelnj/image.png

KaktoR
24-02-2018, 09:23
var
URLText: TNewStaticText;

procedure URLTextClick(Sender: TObject);
var
ErrorCode: Integer;
begin
ShellExec('open', 'http://fileforums.com', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;

procedure InitializeWizard();
begin
URLText := TNewStaticText.Create(WizardForm);
with URLText do begin
Parent := WizardForm;
Left := ScaleX(5);
Top := ScaleY(327);
Width := ScaleX(156);
Height := ScaleY(23);
Caption := 'URL Text';
OnClick := @URLTextClick;
end;
end;

jitender
24-02-2018, 09:30
var
URLText: TNewStaticText;

procedure URLTextClick(Sender: TObject);
var
ErrorCode: Integer;
begin
ShellExec('open', 'http://fileforums.com', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;

procedure InitializeWizard();
begin
URLText := TNewStaticText.Create(WizardForm);
with URLText do begin
Parent := WizardForm;
Left := ScaleX(5);
Top := ScaleY(327);
Width := ScaleX(156);
Height := ScaleY(23);
Caption := 'URL Text';
OnClick := @URLTextClick;
end;
end;

thanks for reply really appericiate.But i don't know even a single line of coding.I have this script so please tell me where to insert this above code:
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "My Program"
#define MyAppVersion "1.5"
#define MyAppPublisher "My Company, Inc."
#define MyAppURL "http://www.example.com/"
#define MyAppExeName "MyProg.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={{0A3E478F-1CFB-4841-BAEE-90B5E62CF3D8}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DisableProgramGroupPage=yes
OutputDir=C:\Users\JS\Downloads
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:\Program Files (x86)\Inno Setup 5\Examples\MyProg.exe; DestDir: {app}; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: {commonprograms}\{#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

pakrat2k2
24-02-2018, 09:51
after the [Run] section add [Code] then paste the lines KaktoR posted.

dont forget to change http://fileforums.com to what you want it to be.

jitender
24-02-2018, 09:53
Ok done thanks.And

-> what about that blue color how to add that?(at bottom in above image)

-> And how to add welcome splash screen?

jitender
24-02-2018, 10:24
#define MyAppName "My Program"
#define MyAppVersion "1.5"
#define MyAppPublisher "My Company, Inc."
#define MyAppURL "http://www.example.com/"
#define MyAppExeName "MyProg.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={{AEB246C4-0FD6-4C59-8EEF-03944CDFDDA5}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DisableProgramGroupPage=yes
OutputDir=C:\Users\JS\Downloads
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:\Program Files (x86)\Inno Setup 5\Examples\MyProg.exe; DestDir: {app}; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: {commonprograms}\{#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

var
URLText: TNewStaticText;

procedure URLTextClick(Sender: TObject);
var
ErrorCode: Integer;
begin
ShellExec('open', 'http://fileforums.com', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;

procedure InitializeWizard();
begin
URLText := TNewStaticText.Create(WizardForm);
with URLText do begin
Parent := WizardForm;
Left := ScaleX(5);
Top := ScaleY(327);
Width := ScaleX(156);
Height := ScaleY(23);
Caption := 'URL Text';
OnClick := @URLTextClick;
end;
end;

I have above script now please tell me the code and where to insert the code.And what to edit in it if necessary.

KaktoR
24-02-2018, 11:56
I guess it's the background color for WizardForm.

Try to change it using this
http://www.jrsoftware.org/ishelp/index.php?topic=setup_backcolor

For splash screen you can use isgsg.dll library (attachment)

How to use:
Add isgsg.dll to script (in [Files] section)
Add Splash.png to script (in [Files] section)

procedure ShowSplashScreen(p1:HWND;p2:AnsiString;p3,p4,p5,p6 ,p7:integer;p8:boolean;p9:Cardinal;p10 :integer);
external 'ShowSplashScreen@files:isgsg.dll stdcall delayload';

procedure InitializeWizard();
ExtractTemporaryFile('Splash.png');
ShowSplashScreen(WizardForm.Handle,ExpandConstant( '{tmp}\Splash.png'), 1000, 1000, 1000, 0, 255, True, $FFFFFF, 10);

jitender
24-02-2018, 13:04
I guess it's the background color for WizardForm.

Try to change it using this
http://www.jrsoftware.org/ishelp/index.php?topic=setup_backcolor

For splash screen you can use isgsg.dll library (attachment)

How to use:
Add isgsg.dll to script (in [Files] section)
Add Splash.png to script (in [Files] section)

procedure ShowSplashScreen(p1:HWND;p2:AnsiString;p3,p4,p5,p6 ,p7:integer;p8:boolean;p9:Cardinal;p10 :integer);
external 'ShowSplashScreen@files:isgsg.dll stdcall delayload';

procedure InitializeWizard();
ExtractTemporaryFile('Splash.png');
ShowSplashScreen(WizardForm.Handle,ExpandConstant( '{tmp}\Splash.png'), 1000, 1000, 1000, 0, 255, True, $FFFFFF, 10);

Thanks again but as i told i don't know coding so please provide me full working script.
I tried adding splash script but it throwing me error.See this image:
https://s9.postimg.org/r802zwavz/image.png

And background color i checked but don't know where to and how to add in script please provide me full script with features(splash,and wizard background color) thank you!

jitender
25-02-2018, 01:00
I am able to run all things now but separately.How to add all these code together.When i try to add it throw me error 'duplicate identifier initialwizard'.

KaktoR
25-02-2018, 02:48
Like error says "duplicate", you have to merge InitializeWizard proceure

And make only one section, not two. You have to merge them too.

[code]var
URLText: TNewStaticText;


procedure ShowSplashScreen(p1:HWND;p2:AnsiString;p3,p4,p5,p6 ,p7:integer;p8:boolean;p9:Cardinal;p10 :integer);
external 'ShowSplashScreen@files:isgsg.dll stdcall delayload';


procedure URLTextClick(Sender: TObject);
var
ErrorCode: Integer;
begin
ShellExec('open', 'http://fileforums.com', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;


procedure InitializeWizard();

ExtractTemporaryFile('Splash.png');
ShowSplashScreen(WizardForm.Handle,ExpandConstant( '{tmp}\Splash.png'), 1000, 1000, 1000, 0, 255, True, $FFFFFF, 10);

begin
URLText := TNewStaticText.Create(WizardForm);
with URLText do begin
Parent := WizardForm;
Left := ScaleX(5);
Top := ScaleY(327);
Width := ScaleX(156);
Height := ScaleY(23);
Caption := 'URL Text';
OnClick := @URLTextClick;
end;
end;

jitender
25-02-2018, 07:25
Like error says "duplicate", you have to merge InitializeWizard proceure

And make only one section, not two. You have to merge them too.

[code]var
URLText: TNewStaticText;


procedure ShowSplashScreen(p1:HWND;p2:AnsiString;p3,p4,p5,p6 ,p7:integer;p8:boolean;p9:Cardinal;p10 :integer);
external 'ShowSplashScreen@files:isgsg.dll stdcall delayload';


procedure URLTextClick(Sender: TObject);
var
ErrorCode: Integer;
begin
ShellExec('open', 'http://fileforums.com', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;


procedure InitializeWizard();

ExtractTemporaryFile('Splash.png');
ShowSplashScreen(WizardForm.Handle,ExpandConstant( '{tmp}\Splash.png'), 1000, 1000, 1000, 0, 255, True, $FFFFFF, 10);

begin
URLText := TNewStaticText.Create(WizardForm);
with URLText do begin
Parent := WizardForm;
Left := ScaleX(5);
Top := ScaleY(327);
Width := ScaleX(156);
Height := ScaleY(23);
Caption := 'URL Text';
OnClick := @URLTextClick;
end;
end;

Something you missed: https://s17.postimg.org/sqjbj97pb/aaa.png

Please give me a tested script which contain that background color for WizardForm(i asked above).Thanks it will save your and mine time please give me a tested one.

STB13
26-02-2018, 07:18
Ok done thanks.And

-> what about that blue color how to add that?(at bottom in above image)

-> And how to add welcome splash screen?

For background Color,
procedure initializewizard();
begin
with wizardform do
begin
Color := clBlue;
end;
end;

jitender
26-02-2018, 09:34
I used "wizard forum desginer ' but i am not able to change text in text field.
See below image and tell me how to change field text?

pakrat2k2
26-02-2018, 11:55
Here's the script that partially works, splash shows properly, but the part STB13 mentioned is in the script, but doesnt seem to display it.

KaktoR
26-02-2018, 12:44
Fixed

jitender
04-03-2018, 10:16
Fixed

thanks now all fine.Only one thing left is how to create these two files from an installer :
1. unpacking portable.cmd
2. silent install.cmd

https://s9.postimg.org/5y57ebg1r/111.png

pakrat2k2
05-03-2018, 07:04
you can open both of those with notepad & see how they are written out.

vint56
05-03-2018, 07:58
jitender

[Setup]
AppName=My Application
AppVersion=1.5
DefaultDirName={code:GetInstallDir|{pf}\My Application}
DisableProgramGroupPage=yes
Uninstallable=not PortableCheck
OutputDir=.

[Files]
Source: "MyProg - installer.exe"; DestDir: "{app}"; Flags: ignoreversion; Check: InstallerCheck;
Source: "MyProg - portable.exe"; DestDir: "{app}"; Flags: ignoreversion; Check: PortableCheck;

[Icons]
Name: "{commondesktop}\My Application"; Filename: "{app}\MyProg - installer.exe"; Check: InstallerCheck;

This is CODE section add [] +Code
var
Portable,Installer: TNewRadioButton;

function CheckParam(s: string): boolean;
var
i: integer;
begin
for i := 0 to ParamCount do begin
Result := ParamStr(i) = s;
if Result then Break;
end;
end;

function GetInstallDir(S: String): String;
begin
if CheckParam('/P') then
Result:= ExpandConstant('{userdesktop}\My Application Portable')
else
Result:= ExpandConstant(S);
end;

function PortableCheck: Boolean;
begin
Result := Portable.Checked or CheckParam('/P');
end;

function InstallerCheck: Boolean;
begin
Result := Installer.Checked or CheckParam('/I');
end;

procedure InitializeWizard();
begin
WizardForm.DirEdit.Text:= ExpandConstant('{code:GetInstallDir|{pf}\My Application}');

Portable := TNewRadioButton.Create(WizardForm);
with Portable do
begin
Parent := WizardForm.SelectDirPage;
Left := ScaleX(110);
Top := ScaleY(175);
Width := ScaleX(100);
Height := ScaleY(17);
Caption := 'Портативная';
Checked := CheckParam('/P');
end;

Installer := TNewRadioButton.Create(WizardForm);
with Installer do
begin
Parent := WizardForm.SelectDirPage;
Left := ScaleX(0);
Top := ScaleY(175);
Width := ScaleX(100);
Height := ScaleY(17);
Caption := 'Стационарная';
Checked := not CheckParam('/P');
end;
end;

Portable
start /wait setup.exe /VERYSILENT /P
Installer
start /wait setup.exe /VERYSILENT /I

jitender
05-03-2018, 08:29
I have this code:
http://fileforums.com/attachment.php?attachmentid=21139&d=1519677850

Now please Download above script and modify it and give me final one which create portable + silent install also.( i don't know coding otherwise i had modified it)

vint56
05-03-2018, 09:34
jitender

#define MyAppName "My Program"
#define MyAppVersion "1.5"
#define MyAppPublisher "My Company, Inc."
#define MyAppURL "http://www.example.com/"
#define MyAppExeName "MyProg.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={{AEB246C4-0FD6-4C59-8EEF-03944CDFDDA5}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={code:GetInstallDir|{pf}\My Application}
DisableProgramGroupPage=yes
Uninstallable=not PortableCheck
OutputDir=.
OutputBaseFilename=setup
Compression=none
SolidCompression=yes
BackColorDirection=lefttoright



[UninstallDelete]
Type: filesandordirs; Name: {app}

[Languages]
Name: english; MessagesFile: compiler:Default.isl

[Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked

[Files]
Source: Include\Splash.png; DestDir: {tmp}; Flags: dontcopy
Source: Include\isgsg.dll; DestDir: {tmp}; Flags: dontcopy

Source: "MyProg - installer.exe"; DestDir: "{app}"; Flags: ignoreversion; Check: InstallerCheck;
Source: "MyProg - portable.exe"; DestDir: "{app}"; Flags: ignoreversion; Check: PortableCheck;


[Icons]
Name: {commonprograms}\{#MyAppName}; Filename: {app}\{#MyAppExeName}
Name: {commondesktop}\{#MyAppName}; Filename: {app}\{#MyAppExeName}; Tasks: desktopicon; Check: InstallerCheck;

[Run]
Filename: {app}\{#MyAppExeName}; Description: {cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}; Flags: nowait postinstall skipifsilent

;Code section add [] to front of line.
var
URLText: TNewStaticText;
Portable,Installer: TNewRadioButton;

procedure ShowSplashScreen(p1:HWND;p2:AnsiString;p3,p4,p5,p6 ,p7:integer;p8:boolean;p9:Cardinal;p10 :integer);
external 'ShowSplashScreen@files:isgsg.dll stdcall delayload';

procedure URLTextClick(Sender: TObject);
var
ErrorCode: Integer;
begin
ShellExec('open', 'http://fileforums.com', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;

function CheckParam(s: string): boolean;
var
i: integer;
begin
for i := 0 to ParamCount do begin
Result := ParamStr(i) = s;
if Result then Break;
end;
end;

function GetInstallDir(S: String): String;
begin
if CheckParam('/P') then
Result:= ExpandConstant('{userdesktop}\My Application Portable')
else
Result:= ExpandConstant(S);
end;

function PortableCheck: Boolean;
begin
Result := Portable.Checked or CheckParam('/P');
end;

function InstallerCheck: Boolean;
begin
Result := Installer.Checked or CheckParam('/I');
end;

procedure NewRadioButton1Click(Sender: TObject);
begin
if Portable.Checked then
WizardForm.DirEdit.Text:= ExpandConstant('{userdesktop}\My Application Portable')
else
WizardForm.DirEdit.Text:= ExpandConstant('{pf}\My Application');
end;

procedure InitializeWizard();
begin
ExtractTemporaryFile('Splash.png');
ShowSplashScreen(WizardForm.Handle,ExpandConstant( '{tmp}\Splash.png'), 1000, 1000, 1000, 0, 255, True, $FFFFFF, 10);

with WizardForm do begin
Color := $d78318;
end;

URLText := TNewStaticText.Create(WizardForm);
with URLText do begin
Parent := WizardForm;
Left := ScaleX(10);
Top := ScaleY(331);
Width := ScaleX(156);
Height := ScaleY(23);
Caption := 'My Website';
Cursor := crHand;
Color := clWhite;
Font.Style := [fsUnderline];
Transparent := True;
OnClick := @URLTextClick;
end;

Portable := TNewRadioButton.Create(WizardForm);
with Portable do
begin
Parent := WizardForm.SelectDirPage;
Left := ScaleX(110);
Top := ScaleY(175);
Width := ScaleX(100);
Height := ScaleY(17);
Caption := 'Портативная';
Checked := CheckParam('/P');
OnClick := @NewRadioButton1Click;
end;

Installer := TNewRadioButton.Create(WizardForm);
with Installer do
begin
Parent := WizardForm.SelectDirPage;
Left := ScaleX(0);
Top := ScaleY(175);
Width := ScaleX(100);
Height := ScaleY(17);
Caption := 'Стационарная';
Checked := not CheckParam('/P');
OnClick := @NewRadioButton1Click;
end;
end;

jitender
05-03-2018, 11:09
Getting these question marks???
https://s17.postimg.org/9wqo7r4n3/aaal.png

DO NOT QUOTE ENTIRE MESSAGE, JUST REPLY

vint56
05-03-2018, 11:18
Portable := TNewRadioButton.Create(WizardForm);
with Portable do
begin
Parent := WizardForm.SelectDirPage;
Left := ScaleX(110);
Top := ScaleY(175);
Width := ScaleX(100);
Height := ScaleY(17);
Caption := 'Portable';
Checked := CheckParam('/P');
OnClick := @NewRadioButton1Click;
end;

Installer := TNewRadioButton.Create(WizardForm);
with Installer do
begin
Parent := WizardForm.SelectDirPage;
Left := ScaleX(0);
Top := ScaleY(175);
Width := ScaleX(100);
Height := ScaleY(17);
Caption := 'Installer';
Checked := not CheckParam('/P');
OnClick := @NewRadioButton1Click;
end;
end;


jitender + vint56 do NOT Quote messages ANY further, just reply to post.
useless to keep quoting previous messages.

jitender
06-03-2018, 00:29
So this script create two options in setup: 1)portable 2)silent install

So, it means if i select portable option then portable version of program will install or if i select silent then it will perform silent installation.Am i right?