Inno Setup (создание инсталяционных пакетов). Часть 3

  • Автор темы Автор темы YURSHAT
  • Дата начала Дата начала
Статус
В этой теме нельзя размещать новые ответы.
Привет. Эсть у кого скрипт Fenixx Game Script v 1.0 by ISDone, то скиньте.
 
I wonder if adding more alternatives must file updates in this script?
And because the setup is a little slow to open?

Мне интересно, если добавить больше альтернатив должна подать обновления в этом сценарии?
И потому, что установка немного медленно открыть?

Код:
#define Theme "Theme.cjstyles"
#define PathUpdate "C:\Users\Matheus Catarino\Desktop\sc-dxhr-1.4.651\*"
#define AppVerName "Deus Ex HR Update 1.4"
#define AppExec "dxhr.exe"
#define AppFile1 "steam_api.dll"
#define AppVersion "1.4"
#define AppFile2 "Steamclient.dll"
#include "Resource\Include\trayiconctrl.iss"

[Setup]
AppName=Deus Ex  Human Revolution
AppVerName={#AppVerName}
UsePreviousAppDir=yes
AppVersion={#AppVersion}
VersionInfoVersion={#AppVersion}
OutputBaseFilename=Setup
DefaultDirName={pf}\SQUARE ENIX\Deus Ex Human Revolution
Uninstallable=false
Compression=lzma
;#ifdef PathUpdate
;DiskSpanning=true
;DiskSliceSize=1556000000
;SlicesPerDisk=3
;SolidCompression=true
;#endif
SolidCompression=yes
SetupIconFile=Resource\Icons\Icon.ico
OutputDir=.
WizardImageFile=Resource\Wizard\Installer.bmp
WizardSmallImageFile=Resource\Wizard\SmallInstaller.bmp

[Languages]
Name: "brazilianportuguese"; MessagesFile: "compiler:Resource\Include\BrazilianPortuguese.isl"

[Files]
#ifdef PathUpdate
Source: {#PathUpdate}; DestDir:"{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
#endif
Source: Resource\Include\callvpatch.dll; Flags: dontcopy
Source: Resource\Include\VPatch.dll; Flags: dontcopy
Source: Patcher\MyPatch.dat; Flags: dontcopy
; Add the ISSkin DLL used for skinning Inno Setup installations.
Source: Resource\Include\ISSkin.dll; DestDir: {app}; Flags: dontcopy

; Add the Visual Style resource contains resources used for skinning,
; you can also use Microsoft Visual Styles (*.msstyles) resources.
Source: Resource\Include\{#Theme}; DestDir: {tmp}; Flags: dontcopy

[Code - setup]
function GetCursorPos(var lpPoint: TPoint): BOOL; external 'GetCursorPos@user32.dll stdcall';
function IsWindowEnabled(hWnd: HWND): BOOL; external 'IsWindowEnabled@user32.dll stdcall';

const
  WM_USER = $400;
 	WM_ICON_NOTIFY = WM_USER + 22;
  WM_RBUTTONUP = $205;
var
  PupMnu: TPopupMenu; VersionText: TNewStaticText;

procedure MenuOnClick(Sender: TObject);
begin
  case TMenuItem(Sender).HelpContext of
  101: ToggleWizardVisible;
  102: MainForm.ShowAboutBox;
  103: WizardForm.Close;
  end;
  WizardForm.BringToFront;
end;

procedure PMenuOnPopup(Sender: TObject);
begin
  PupMnu.Items.Items[2].Enabled := not WizardFormInTray;
  PupMnu.Items.Items[4].Enabled := not WizardFormInTray;
end;

function LOWORD(DW: LongWord): LongWord;
begin
  Result := DW and $FFFF;
end;

function MyTrayIconMsgCallBack(wParam, lParam: LongWord): Boolean;
var
  lpPoint: TPoint;
begin
  Result := False;
  if LOWORD(lParam) = WM_RBUTTONUP then 
    if IsWindowEnabled(WizardForm.Handle) then 
    begin
      GetCursorPos(lpPoint);
      PupMnu.Popup(lpPoint.x, lpPoint.y);
      Result := True; 
    end;
end;

// Importing LoadSkin API from ISSkin.DLL
procedure LoadSkin(lpszPath: String; lpszIniFileName: String);
external 'LoadSkin@files:isskin.dll stdcall';

// Importing UnloadSkin API from ISSkin.DLL
procedure UnloadSkin();
external 'UnloadSkin@files:isskin.dll stdcall';

// Importing ShowWindow Windows API from User32.DLL
function ShowWindow(hWnd: Integer; uType: Integer): Integer;
external 'ShowWindow@user32.dll stdcall';
function InitializeSetup(): Boolean;
begin
  ExtractTemporaryFile('{#Theme}');
  LoadSkin(ExpandConstant('{tmp}\{#Theme}'), '');
  Result := True;
  end; 
 procedure DeinitializeSetup();
begin
  // Hide Window before unloading skin so user does not get
  // a glimpse of an unskinned window before it is closed.
  ShowWindow(StrToInt(ExpandConstant('{wizardhwnd}')), 0);
  UnloadSkin();
  MainForm.Hide;
  WizardForm.Hide;
  UninitTrayIconCtrl();
 end;

procedure InitializeWizard;
 begin
  with WizardForm do begin
   WizardForm.WizardBitmapImage2.Width:= ScaleX(497);
   WizardBitmapImage.Width := ClientWidth;
      WizardSmallBitmapImage.Left := MainPanel.Left;
   WizardSmallBitmapImage.Width := MainPanel.Width;
   FinishedHeadingLabel.Hide;
   WizardBitmapImage.Parent := WelcomePage;
   FinishedLabel.Hide;
   VersionText := TNewStaticText.Create(WizardForm);
   PageDescriptionLabel.Hide;
   PageNameLabel.Hide;
   WelcomeLabel2.Hide;
   WelcomeLabel1.Hide;
  end;
    with VersionText do
   begin 
    Name := 'VersionText';
    Parent := WizardForm;
    Caption := '{#AppVerName}';  // CHANGE VERSION NUMBER ACCORDING TO SETUP, OR LEAVE ENTIRELY
    Color := clBtnFace;
    Enabled := False;
    ParentColor := False;
    Left := ScaleX(44);
    Top := ScaleY(331);
    Width := ScaleX(154); // 74 WITHOUT VERSION NUMBER
    Height := ScaleY(14);
  end;
 begin
  ExtractTemporaryFile('VPatch.dll');
  ExtractTemporaryFile('MyPatch.dat');
 end;
 begin
 PupMnu := NewPopupMenu(WizardForm, 'MyPopupMenu', paLeft, True, [
      NewItem('&Show/Hide WizardForm', 0, False, True, @MenuOnClick, 101, 'piShowHideWizardForm'),
      NewLine,
      NewItem('&About...', 0, False, True, @MenuOnClick, 102, 'piAbort'),
      NewLine,
      NewItem('E&xit', 0, False, True, @MenuOnClick, 103, 'piExit')
  ]);
  PupMnu.OnPopup := @PMenuOnPopup;

  InitTrayIconCtrl(MainForm.Handle, WizardForm.Handle,
			 WM_ICON_NOTIFY,        
			 '{#AppVerName}',       
			 0,                    
       True,                 
			 False,                
			 '',                    
			 -1,                   
			 nil,                   
			 nil,                   
			 @MyTrayIconMsgCallBack 
			 );


  ShowBalloon('Setup is starting...', '{#AppVerName} By Kassane', 0, 10, False);
 end;
end;
const
  BackupDir = 'Backup';
  PatchFile = 'MyPatch.dat';
  
function vpatch(parentwnd: Integer; pluginname,funcname,param1,param2,param3: PChar): Integer;
external 'vpatch@files:callvpatch.dll stdcall';

function PatchFileFunc(FileName: String): Integer;
begin        
  Result := vpatch(0,ExpandConstant('{tmp}\VPatch.dll'),'vpatchfile',ExpandConstant('{tmp}\'+PatchFile),
       ExpandConstant('{app}\'+BackupDir+'\'+FileName),ExpandConstant('{app}\'+FileName));
end;

procedure BackupFile(FileName: String);
begin
  if not FileExists(ExpandConstant('{app}\'+BackupDir+'\'+Filename)) then
    FileCopy(ExpandConstant('{app}\'+Filename),ExpandConstant('{app}\'+BackupDir+'\'+Filename),True);
end;

procedure RestoreFile(FileName: String);
begin
  FileCopy(ExpandConstant('{app}\'+BackupDir+'\'+Filename),ExpandConstant('{app}\'+Filename),False);
  DeleteFile(ExpandConstant('{app}\'+BackupDir+'\'+Filename));
end;

function NextButtonClick(CurPageID: Integer): Boolean;
begin
  if CurPageID = wpSelectDir then
    Result := FileExists(ExpandConstant('{app}\{#AppExec}'))
  else
    Result := True;
  if not Result then
    MsgBox('Não Encontrado', mbInformation, MB_OK);
end;

procedure CurPageChanged(CurPageID: Integer);
begin
  if CurPageID = wpInstalling then
  begin
    CreateDir(ExpandConstant('{app}\'+BackupDir));
    
    BackupFile('{#AppExec}');
    if PatchFileFunc('{#AppExec}') = 1 then
      RestoreFile('{#AppExec}')
    WizardForm.PROGRESSGAUGE.POSITION := 33;
    
    BackupFile('{#AppFile1}');
    if PatchFileFunc('{#AppFile1}') = 1 then
      RestoreFile('{#AppFile1}')
    WizardForm.PROGRESSGAUGE.POSITION := 66;
    
    BackupFile('{#AppFile2}');
    if PatchFileFunc('{#AppFile2}') = 1 then
      RestoreFile('{#AppFile2}')
    WizardForm.PROGRESSGAUGE.POSITION := 100;
  end;
end;

My Patcher Installer
 
Не факт, двойная буферизация на других системах не всегда помогает и картинки остаются моргать.

Никто не знает в чем может быть проблема?
Cкрыть InnerNotebook/OuterNotebook - но все компоненты придётся делать вручную.
 
Последнее редактирование:
Как закруглить по краям wizardform? пробывал так
FormRegion:=CreateRoundRectRgn(0,0,WizardForm.ClientWidth,WizardForm.ClientHeight,9,9);
SetWindowRgn(WizardForm.Handle,FormRegion,True);
но не робит.
 
sergey3695,
примерчик
 
Последнее редактирование:
sergey3695,
примерчик
 
Последнее редактирование:
как сделать так
45522612206545846178.png
 
подскажите как объединить Tasks и components в одну страницу???
 
Последнее редактирование:
подскажите как объединить Tasks и components в одну страницу???

Если я тебя правильно понял то так
[SOURCE="inno"][Setup]
AppName=My Program
AppVerName=My Program v 1.5
DefaultDirName={pf}\My Program

[Types]
Name: full; Description: Full installation; Flags: iscustom

[Components]
Name: text; Description: Язык субтитров; Types: full; Flags: fixed
Name: text\rus; Description: Русский; Flags: exclusive;
Name: text\eng; Description: Английский; Flags: exclusive;
Name: voice; Description: Язык озвучки; Types: full; Flags: fixed
Name: voice\rus; Description: Русский; Flags: exclusive;
Name: voice\eng; Description: Английский; Flags: exclusive;

[Tasks]
Name: DirectX; Description: Microsoft DirectX;
Name: VCRedist; Description: Microsoft VCRedist;

Name: DesktopIcon; Description: Ярлык На Рабочем Столе;
Name: StartMenuIcon; Description: Ярлык В Меню Пуск;

Код:
function ShouldSkipPage(PageID: Integer): Boolean;
begin
  if (PageID =wpSelectComponents) then
  Result:= True;
end;

procedure RedesignWizardForm;
begin
    WizardForm.ComponentsList.Parent := WizardForm.SelectTasksPage;
    WizardForm.ComponentsList.SetBounds(ScaleX(0),ScaleY(37),ScaleX(207),ScaleY(192));

    WizardForm.TasksList.SetBounds(ScaleX(210),ScaleY(37),ScaleX(207),ScaleY(192));
    WizardForm.TasksList.BorderStyle := bsSingle;
    WizardForm.TasksList.Color := clWhite;
end;

procedure InitializeWizard();
begin
  RedesignWizardForm;
end;[/SOURCE][/SPOILER]
 
Adil,
а если я закоментю компоненты. как сделать что бы софт растягивался на всё страницу??
 
Adil,
протупил... извиняюсь, был не внимателен, нашёл размер окошек )))
 
Как сделать чтобы нужный мне софт устанавливался, в скрытом режиме. При этом DirectX и VCRedist у меня уже так устанавливается, а этот файл нет.
 
Последнее редактирование:
Как сделать чтобы нужный мне софт устанавливался, в скрытом режиме. При этом DirectX и VCRedist у меня уже так устанавливается, а этот файл нет.
Код:
[Run]
Filename: {src}\Redist\DirectX\dxsetup.exe; WorkingDir: {src}\Redist\DirectX\; [B]Parameters: /silent[/b]; Flags: waituntilterminated;

Ключи для тихой установки смотри в интернете. По окну смею предположить, что это инно, значит используй ключ "/VERYSILENT"
 
Sal'vador, так-то Inno Setup тут никаким боком совершенно. Но вообще там написано, что не хватает свободной памяти. (Эт я в гуглопереводчике перевел, там пара секуд всего) прощу обращать на слово свободной. Это значит, что если у тебя 10 тереабайт оперативки, то это не значит, что вся она доступна. На х32 ос, например, ее доступно 3,2 гектара минус то, что занято работающими приложениями и системой.
 
Статус
В этой теме нельзя размещать новые ответы.
Назад
Сверху