FileForums

FileForums (https://fileforums.com/index.php)
-   Conversion Tutorials (https://fileforums.com/forumdisplay.php?f=55)
-   -   How to add web url in innosetup? (https://fileforums.com/showthread.php?t=101502)

jitender 04-03-2018 10:16

Quote:

Originally Posted by KaktoR (Post 468465)
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
Code:

[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...9&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
Code:

#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?


All times are GMT -7. The time now is 01:22.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
FileForums @ https://fileforums.com