[архив] Inno Setup .:[все вопросы]:.

Ответить
 • Просмотры: 3
Аватара пользователя
p3rf3ct1c

Re: [архив] Inno Setup .:[все вопросы]:.

Сообщение p3rf3ct1c »

Elka80, в вашей Akella Games папке наверно нет файлов
Аватара пользователя
Serega

Re: [архив] Inno Setup .:[все вопросы]:.

Сообщение Serega »

Цитата heNch1g:



Изменил на {app}\cstrike\config.cfg, но он не копирует файл если папки cstrike нету.

Заранее огромное спасибо.
[архив] Inno Setup .:[все вопросы]:.




Видимо, нужно её создать.



Код:

Код: Выделить всё

CreateDir(ExpandConstant('{app}\cstrike'));
FileCopy(str, ExpandConstant('{app}\cstrike\config.cfg'), False);
Аватара пользователя
heNch1g

Re: [архив] Inno Setup .:[все вопросы]:.

Сообщение heNch1g »

Цитата heNch1g:



но есть вопросы
[архив] Inno Setup .:[все вопросы]:.





Попробуйте




Код:

Код: Выделить всё

[Setup]
AppName=My Program
AppVerName=My Program v 1.5
DefaultDirName={pf}\My Program
OutputDir=.
Compression=lzma/ultra
InternalCompressLevel=ultra
SolidCompression=yes
[Languages]
Name: russian; MessagesFile: compiler:Languages\Russian.isl
[Tasks]
Name: cfg; Description: Использовать ваш файл настроек; GroupDescription: Дополнительно:; Flags: unchecked
[Files]
Source: compiler:Examples\MyProg.exe; DestDir: {app}; Tasks: cfg
[UninstallDelete]
Name: {app}; Type: filesandordirs
[Code]
var
  str: string;
  btn: TButton;
  edt: TEdit;
  lbl, lbl1, lbl2: TLabel;
  MainPage: TWizardPage;
procedure btnOnClick(Sender: TObject);
var
  S: TArrayOfString;
  i: Integer;
begin
  if GetOpenFileName('', str, ExpandConstant('{srcexe}'), 'Файл настроек (*.cfg)|*.cfg', '') then
  if str  '' then
    begin
      edt.Text:= str;
      if LoadStringsFromFile(str, S) then
        begin
          lbl1.Caption:= '';
          lbl2.Caption:= '';
          for i:= 0 to GetArrayLength(S)-1 do
            begin
              if Pos('name "myname"', S[i]) > 0 then
                lbl1.Caption:= 'Строка № ' + IntToStr(i)+ ': ' + S[i];
              if Pos('commanda_primer "9"', S[i]) > 0 then
                lbl2.Caption:= 'Строка № ' + IntToStr(i)+ ': ' + S[i];
            end;
        end;
    end;
end;
procedure CreatePage;
begin
  MainPage:= CreateCustomPage(wpSelectTasks, 'Caption', 'Description');
  btn:= TButton.Create(MainPage);
  with btn do
    begin
      SetBounds(330, 83, 75, 25);
      Caption:= 'Обзор';
      OnClick:= @btnOnClick;
      Parent:= MainPage.Surface;
    end;
  edt:= TEdit.Create(MainPage);
  with edt do
    begin
      SetBounds(20, 85, 300, 23);
      Parent:= MainPage.Surface;
    end;
  lbl:= TLabel.Create(MainPage);
  with lbl do
    begin
      SetBounds(0, 30, 300, 80);
      AutoSize:= True;
      Caption:= 'бла-бла-бла...';
      Parent:= MainPage.Surface;
    end;
  lbl1:= TLabel.Create(MainPage);
  with lbl1 do
    begin
      SetBounds(20, 110, 300, 23);
      AutoSize:= True;
      Parent:= MainPage.Surface;
    end;
  lbl2:= TLabel.Create(MainPage);
  with lbl2 do
    begin
      SetBounds(20, 130, 300, 23);
      AutoSize:= True;
      Parent:= MainPage.Surface;
    end;
end;
procedure InitializeWizard();
begin
  CreatePage;
end;
function ShouldSkipPage(CurPage: Integer): Boolean;
begin
  if not IsTaskSelected('cfg') then
  if CurPage = MainPage.ID then Result:= True;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
  if CurPageID > wpInstalling then
    begin
      if IsTaskSelected('cfg') then
      if str  '' then
        begin
          if not DirExists(ExpandConstant('{app}\cstrike')) then
          CreateDir(ExpandConstant('{app}\cstrike'));
          FileCopy(str, ExpandConstant('{app}\cstrike\config.cfg'), False);
        end;
    end;
end;
Аватара пользователя
serg aka lain

Re: [архив] Inno Setup .:[все вопросы]:.

Сообщение serg aka lain »

Люди хелп!При компиляции выбивает ошибку вот на етом месте:

BmpFile:= TBitmapImage.Create(WizardForm);

BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\1.bmp'));

BmpFile.SetBounds(0, 0, 497, 360);

BmpFile.Stretch:= true

BmpFile.Parent:= WizardForm.WelcomePage;

BmpFile:= TBitmapImage.Create(WizardForm);

BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\1.bmp'));

BmpFile.SetBounds(0, 0, 497, 360);

BmpFile.Stretch:= true

BmpFile.Parent:= WizardForm.LicensePage;

BmpFile:= TBitmapImage.Create(WizardForm);

BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\2.bmp'));

BmpFile.SetBounds(0, 0, 497, 360);

BmpFile.Stretch:= true

BmpFile.Parent:= WizardForm.SelectDirPage;

BmpFile:= TBitmapImage.Create(WizardForm);

BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\2.bmp'));

BmpFile.SetBounds(0, 0, 497, 360);

BmpFile.Stretch:= true

BmpFile.Parent:= WizardForm.InstallingPage;

BmpFile:= TBitmapImage.Create(WizardForm);

BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\3.bmp'));

BmpFile.SetBounds(0, 0, 497, 360);

BmpFile.Stretch:= true

BmpFile.Parent:= WizardForm.FinishedPage;

BmpFile:= TBitmapImage.Create(WizardForm);

Подскажите плз решение.
Аватара пользователя
Serega

Re: [архив] Inno Setup .:[все вопросы]:.

Сообщение Serega »

Цитата kolobrodik:



При компиляции выбивает ошибку
[архив] Inno Setup .:[все вопросы]:.




Какую ошибку?

Предполагаю, что не при компиляции, а в момент запуска инсталлятора, следовательно, вы пытаетесь загрузить файл, которого нет.

В секции [Files] должно быть:



Код:

Код: Выделить всё

[Files]
Source: ..\1.bmp; DestDir: {tmp}

т.е. вы должны изначально извлечь файл 1.bmp в 'Temp', а потом уже пытаться его загрузить...



P.S.

Пользуйтесь тегами, а именно при показе скрипта, используйте [mоre][сode][/code][/more]
Аватара пользователя
kolobrodik

Re: [архив] Inno Setup .:[все вопросы]:.

Сообщение kolobrodik »

Люди хелп!При компиляции выбивает ошибку вот на етом месте:

BmpFile:= TBitmapImage.Create(WizardForm);

BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\1.bmp'));

BmpFile.SetBounds(0, 0, 497, 360);

BmpFile.Stretch:= true

BmpFile.Parent:= WizardForm.WelcomePage;

BmpFile:= TBitmapImage.Create(WizardForm);

BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\1.bmp'));

BmpFile.SetBounds(0, 0, 497, 360);

BmpFile.Stretch:= true

BmpFile.Parent:= WizardForm.LicensePage;

BmpFile:= TBitmapImage.Create(WizardForm);

BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\2.bmp'));

BmpFile.SetBounds(0, 0, 497, 360);

BmpFile.Stretch:= true

BmpFile.Parent:= WizardForm.SelectDirPage;

BmpFile:= TBitmapImage.Create(WizardForm);

BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\2.bmp'));

BmpFile.SetBounds(0, 0, 497, 360);

BmpFile.Stretch:= true

BmpFile.Parent:= WizardForm.InstallingPage;

BmpFile:= TBitmapImage.Create(WizardForm);

BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\3.bmp'));

BmpFile.SetBounds(0, 0, 497, 360);

BmpFile.Stretch:= true

BmpFile.Parent:= WizardForm.FinishedPage;

BmpFile:= TBitmapImage.Create(WizardForm);

Подскажите плз решение.
Аватара пользователя
Serega

Re: [архив] Inno Setup .:[все вопросы]:.

Сообщение Serega »

zl0ybot, EagleSH делает инсталляторы не в инно, поэтому, кроме как вставить swf, которое перекроет все элементы, кроме кнопок и edit'ов, на wizardform, ничего не получится.
Аватара пользователя
zl0ybot

Re: [архив] Inno Setup .:[все вопросы]:.

Сообщение zl0ybot »

Hello all! вы не могли бы довести этот скрипт до ума и вставить freearc (в архиве скрипт, dl, video *.swf) надо бы так сделать Изображение
читать дальше »


Изображение Изображение

жду вашего ответа
http://rapidshare.com/files/266190726/1.7z.htm
или хотя бы были надписи появились
Аватара пользователя
BlackSelf

Re: [архив] Inno Setup .:[все вопросы]:.

Сообщение BlackSelf »

zl0ybot, EagleSH делает инсталляторы не в инно, поэтому, кроме как вставить swf, которое перекроет все элементы, кроме кнопок и edit'ов, на wizardform, ничего не получится.
Аватара пользователя
heNch1g

Re: [архив] Inno Setup .:[все вопросы]:.

Сообщение heNch1g »

Все привет надо бы вот этот скрипт доделать
читать дальше »


[setup]

AppName=Hitman

AppVerName=Hitman

DefaultDirName={pf}\Hitman

OutputDir=.

WizardImageFile=WizardImageFile.bmp

WizardSmallImageFile=WizardSmallImageFile.bmp

DisableReadyPage=true

UninstallFilesDir={app}\Uninstall



[Languages]

Name: "ENG"; MessagesFile: "compiler:Default.isl"

Name: "RUS"; MessagesFile: "compiler:Languages\Russian.isl"



[Files]



Source: 3.bmp; DestDir: {tmp}; Flags: dontcopy

Source: 1.bmp; Flags: dontcopy;



[Run]

Filename: {src}\DirectX\dxsetup.exe; Parameters: /silent; StatusMsg: ExpandConstant('{cm:UP}'); Check: DirectX



[CustomMessages]

ENG.PAGE_CAPTION=Setup has finished installing Vin Diesel Wheelman on your computer.

RUS.PAGE_CAPTION=Программа Vin Diesel Wheelman установлена на Ваш компютер.

ENG.STR=Click Finish to exit Setup.

RUS.STR=Нажмите «Завершить», чтобы выйти из программы установки.

ENG.BUT=Install

RUS.BUT=Установить

ENG.SPACE=Available place on disk:

RUS.SPACE=Доступно места на диске:

ENG.SPACE1=Place is Required on disk:

RUS.SPACE1=Требуется места на диске:

ENG.DRT=Will Update DirectX

RUS.DRT=Обновить DirectX

ENG.UP=Goes the renovation DirectX...

RUS.UP=Идет обновление DirectX...

ENG.GB=GB

RUS.GB=Гб

[_CODE_]



var

Upload: TCheckBox;

bottom_img:TBitmapImage;

lblCheckBox, lblSelectDir, lblSelectDirBrowse: TLabel;

PageNameLabel, PageDescriptionLabel: TLabel;

WLabel1, WLabel2,

FLabel1, FLabel2, FLabel3: TLabel;

NeedSize:Integer;

FreeMB, TotalMB: Cardinal;

NeedSpaceLabel,FreeSpaceLabel: TLabel;

BmpFile: TBitmapImage;



function DirectX: Boolean;

begin

Result:=Upload.Checked;

end;



procedure GetFreeSpaceCaption(Sender: TObject);

var

Path: String;

begin

Path := ExtractFileDrive(WizardForm.DirEdit.Text);

GetSpaceOnDisk(Path, True, FreeMB, TotalMB);

if FreeMB > 1024 then

FreeSpaceLabel.Caption := ExpandConstant('{cm:SPACE} ')+ FloatToStr(round(FreeMB/1024*100)/100) + ExpandConstant(' {cm:GB}') else

FreeSpaceLabel.Caption := ExpandConstant('{cm:SPACE} ')+ IntToStr(FreeMB)+ ' MB';

if FreeMB < NeedSize then

WizardForm.NextButton.Enabled := False else

WizardForm.NextButton.Enabled := True;

end;



procedure GetNeedSpaceCaption;

begin

if NeedSize > 1024 then

NeedSpaceLabel.Caption := ExpandConstant('{cm:SPACE1} ')+ FloatToStr(round(NeedSize/1024*100)/100) + ExpandConstant(' {cm:GB}') else

NeedSpaceLabel.Caption := ExpandConstant('{cm:SPACE1} ')+ IntToStr(NeedSize)+ ' MB';

end;



// задал процедуру, чтоб отмечался чебокс еси кликнуть по надписи lblCheckBox

procedure lblCheckBoxOnClick(Sender: TObject);

begin

if Upload.Checked = False then

Upload.Checked:= True else

Upload.Checked:= False;

end;



procedure InitializeWizard();

begin

WizardForm.FileNameLabel.Visible:= False;

ExtractTemporaryFile('1.bmp');

ExtractTemporaryFile('3.bmp');



NeedSize:= 7000;



BmpFile:= TBitmapImage.Create(WizardForm);

BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\1.bmp'));

BmpFile.Width:= ScaleX(497);

BmpFile.Height:= ScaleY(252);

BmpFile.Parent:= WizardForm.SelectDirPage;





bottom_img:= TBitmapImage.Create(WizardForm);

bottom_img.Bitmap.LoadFromFile(ExpandConstant('{tmp}\3.bmp'));

{первые 2 параметра - координаты левогого верхнего угла по горизонтали и вертикали, дальше ширина и высота,

до которой растянуть}

bottom_img.SetBounds(0, 315, 497, 48);

bottom_img.Parent:= WizardForm;

bottom_img.Stretch:= True;



with WizardForm do

begin

PageNameLabel.Hide;

PageDescriptionLabel.Hide;

WelcomeLabel1.Hide;

WelcomeLabel2.Hide;

DiskSpaceLabel.Hide;

SelectDirBitmapImage.Hide;

SelectDirBrowseLabel.Hide;

SelectDirLabel.Hide;

FinishedHeadingLabel.Hide;

FinishedLabel.Hide;



DirBrowseButton.Left:= DirBrowseButton.Left + ScaleX(40);

DirBrowseButton.Top:= DirBrowseButton.Top + ScaleY(12);

DirEdit.Left:= DirEdit.Left + ScaleX(40);

DirEdit.Top:= DirEdit.Top + ScaleY(12);



WizardBitmapImage.Width:= 497;

WizardBitmapImage.Height:= 314;

WizardBitmapImage2.Width:= 497;

WizardBitmapImage2.Height:= 314;

with MainPanel do

begin

with WizardSmallBitmapImage do

begin

Left:= Mainpanel.Left;

Top:= Mainpanel.Top;

Width:= Mainpanel.Width;

Height:= MainPanel.Height;

end;

end;

end;



WLabel1:= TLabel.Create(WizardForm);

with WLabel1 do

begin

Left:= ScaleX(176);

Top:= ScaleY(16);

Width:= ScaleX(301);

Height:= ScaleY(54);

AutoSize:= False;

WordWrap:= True;

Font.Size:= 12;

Font.Style:= [fsBold];

Font.Color:= clwhite;

ShowAccelChar:= False;

Caption:= WizardForm.WelcomeLabel1.Caption;

Transparent:= True;

Parent:= WizardForm.WelcomePage;

end;



WLabel2:=TLabel.Create(WizardForm);

with WLabel2 do

begin

Top:= ScaleY(76);

Left:= ScaleX(176);

Width:= ScaleX(301);

Height:= ScaleY(234);

AutoSize:= False;

WordWrap:= True;

Font.Color:= clWhite;

ShowAccelChar:= False;

Caption:= WizardForm.WelcomeLabel2.Caption;

Transparent:= True;

Parent:= WizardForm.WelcomePage;

end;



FLabel1:= TLabel.Create(WizardForm);

with FLabel1 do

begin

Left:= ScaleX(176);

Top:= ScaleY(16);

Width:= ScaleX(301);

Height:= ScaleY(54);

AutoSize:= False;

WordWrap:= True;

Font.Size:= 12;

Font.Style:= [fsBold];

Font.Color:= clWhite;

ShowAccelChar:= False;

Caption:= WizardForm.FinishedHeadingLabel.Caption;

Transparent:= True;

Parent:= WizardForm.FinishedPage;

end;



FLabel2:=TLabel.Create(WizardForm);

with FLabel2 do

begin

Top:= ScaleY(76);

Left:= ScaleX(176);

Width:= ScaleX(301);

Height:= ScaleY(53);

AutoSize:= False;

WordWrap:= True;

Font.Color:= clWhite;

ShowAccelChar:= False;

Caption:= ExpandConstant('{cm:PAGE_CAPTION}');

Transparent:= True;

Parent:= WizardForm.FinishedPage;

end;



FLabel3 :=TLabel.Create(WizardForm);

with FLabel3 do

begin

Top := ScaleY(110);

Left := ScaleX(176);

Width := ScaleX(301);

Height := ScaleY(53);

AutoSize := False;

WordWrap := True;

Font.Color:= clblack;

ShowAccelChar := False;

Caption := ExpandConstant('{cm:STR}');

Transparent := True;

Parent := WizardForm.FinishedPage;

end;



// уменьшил размер CheckBox'а, по другому никак

Upload:= TCheckBox.Create(WizardForm);

with Upload do

begin

Parent:= WizardForm.SelectDirPage;

Left:= WizardForm.DirEdit.Left;

Top:= WizardForm.DirEdit.Top + 35;

Width:= ScaleX(14);

Height:= ScaleY(14);

TabOrder:= 0;

Checked:= False;

end;



// создаём надпись для CheckBox'а

lblCheckBox:= TLabel.Create(WizardForm);

with lblCheckBox do

begin

Caption:= ExpandConstant('{cm:DRT}');

Left:= WizardForm.DirEdit.Left + 20;

Top:= WizardForm.DirEdit.Top + 35;

Width:= ScaleX(150);

Height:= ScaleY(13);

Transparent := True;

Parent:= WizardForm.SelectDirPage;

OnClick:= @lblCheckBoxOnClick;

end;



// создаём lblSelectDir

lblSelectDir:= TLabel.Create(WizardForm);

with lblSelectDir do

begin

Caption:= WizardForm.SelectDirLabel.Caption;

Left:= ScaleX(40);

Top:= WizardForm.SelectDirLabel.Top + ScaleY(12);

Width:= WizardForm.SelectDirLabel.Width;

Height:= WizardForm.SelectDirLabel.Height;

Transparent := True;

Parent:= WizardForm.SelectDirPage;

end;



// создаём lblSelectDirBrowse

lblSelectDirBrowse:= TLabel.Create(WizardForm);

with lblSelectDirBrowse do

begin

Caption:= WizardForm.SelectDirBrowseLabel.Caption;

Left:= ScaleX(40);

Top:= WizardForm.SelectDirBrowseLabel.Top + ScaleY(12);

Width:= WizardForm.SelectDirBrowseLabel.Width;

Height:= WizardForm.SelectDirBrowseLabel.Height;

WordWrap:= True;

Transparent:= True;

Parent:= WizardForm.SelectDirPage;

end;



NeedSpaceLabel:= TLabel.Create(WizardForm);

with NeedSpaceLabel do

begin

Parent:= WizardForm.SelectDirPage;

Left:= WizardForm.DirEdit.Left;

Top:= ScaleY(202);

Width:= ScaleX(209);

Height:= ScaleY(13);

Transparent:= True;

end;



FreeSpaceLabel:= TLabel.Create(WizardForm);

with FreeSpaceLabel do

begin

Parent:= WizardForm.SelectDirPage;

Left:= WizardForm.DirEdit.Left;

Top:= ScaleY(220);

Width:= ScaleX(209);

Height:= ScaleY(13);

Transparent:= True;

end;



WizardForm.DirEdit.OnChange:= @GetFreeSpaceCaption;

WizardForm.DirEdit.Text:= WizardForm.DirEdit.Text + #0;



PageNameLabel:= TLabel.Create(WizardForm);

with PageNameLabel do

begin

Left:= ScaleX(10);

Top:= ScaleY(10);

Width:= ScaleX(300);

Height:= ScaleY(14);

AutoSize:= False;

WordWrap:= True;

Font.Color:= clblack;

Font.Style:= [fsBold];

Transparent:= True;

Parent:= WizardForm.MainPanel;

end;



PageDescriptionLabel:= TLabel.Create(WizardForm);

with PageDescriptionLabel do

begin

Left:= ScaleX(15);

Top:= ScaleY(25);

Width:= ScaleX(475);

Height:= ScaleY(30);

AutoSize:= False;

WordWrap:= True;

Font.Color:= clblack;

Transparent:= True;

Parent:= WizardForm.MainPanel;

end;

end;



procedure CurPageChanged(CurPageID: Integer);

begin

PageNameLabel.Caption:= WizardForm.PageNameLabel.Caption;

PageDescriptionLabel.Caption:= WizardForm.PageDescriptionLabel.Caption;

if CurPageID = wpSelectDir then

begin

WizardForm.NextButton.Caption:= ExpandConstant('{cm:BUT}');

GetNeedSpaceCaption;

if FreeMB < NeedSize then

WizardForm.NextButton.Enabled:=False;

with WizardForm do

begin

InnerNotebook.Left := ScaleX(0);

InnerNotebook.Top := ScaleY(60);

InnerNotebook.Width := ScaleX(497);

InnerNotebook.Height := ScaleY(252)

end;

end;

if CurPageID = wpInstalling then

begin

with WizardForm do

begin

BmpFile.Parent:= WizardForm.InstallingPage;

ProgressGauge.Left:= 20;

ProgressGauge.Top:= 160;

ProgressGauge.Width:= 215;

ProgressGauge.Height:= 20;

end;

end;

end;

вот не достататки
читать дальше »




а патом все соединить с этим скриптом
читать дальше »


#define MainExe "{app}\Smersh.exe"

#define GDFBinary "{app}\Smersh.exe"



[Setup]

AppName=Смерть шпионам.Момент истины

AppVerName=Смерть шпионам.Момент истины

DefaultDirName={pf}\Смерть шпионам.Момент истины

OutputDir=Output

Compression=none

DisableReadyPage=true

InternalCompressLevel=ultra64

SolidCompression=true

ArchitecturesInstallIn64BitMode=x64

ArchitecturesAllowed=x64 x86

RestartIfNeededByRun=false

UsePreviousAppDir=false

DirExistsWarning=no

DisableProgramGroupPage=true

DefaultGroupName=Bully

UsePreviousGroup=false

UsePreviousSetupType=false

UsePreviousTasks=false

UninstallFilesDir={app}\Uninstall

[Files]

Source: arc.exe; DestDir: {tmp}; Flags: dontcopy

Source: GameuxInstallHelper.dll; DestDir: {app}\Uninstall; Flags: overwritereadonly ignoreversion

[Languages]

Name: rus; MessagesFile: compiler:Languages\Russian.isl



[Messages]

SelectDirBrowseLabel=Нажмите «Установить», чтобы начать установку. Если Вы хотите выбрать другую папку, нажмите «Обзор».

[LangOptions]

WelcomeFontName=Tahoma

WelcomeFontSize=11



[Registry]

Root: HKLM; SubKey: SOFTWARE\1C\{{E07CEDD1-108A-4304-B820-EAFF5D37F5F0}; ValueType: string; ValueName: InstallDir; ValueData: {app}\

Root: HKLM; SubKey: SOFTWARE\1C\{{E07CEDD1-108A-4304-B820-EAFF5D37F5F0}; ValueType: string; ValueName: AppFile; ValueData: {app}\SmershAddon.exe

Root: HKLM; SubKey: SOFTWARE\1C\{{E07CEDD1-108A-4304-B820-EAFF5D37F5F0}; ValueType: string; ValueName: AppVersion; ValueData: 1.0.0.0



[Run]

Filename: {app}\Smersh.exe; WorkingDir: {app}\; Description: Начать игру; Flags: postinstall

Filename: {src}\DirectX\DXSETUP.exe; Parameters: /silent; StatusMsg: Обновление:Microsoft DirectX 9.0c...; Check: InstallDirectX

Filename: {src}\Redistributables\vcredist_x86.exe; Parameters: "/q:a /c:""VCREDI~3.EXE /q:a /c:""""msiexec /i vcredist.msi /qn"""" """; StatusMsg: Обновление:Microsoft Visual C++ 2005...; Check: InstallDirectX



[Icons]

Name: {group}\Играть; Filename: {app}\Smersh.exe; WorkingDir: {app}\

Name: {group}\Настроить игру; Filename: {app}\SmershSetup.exe; WorkingDir: {app}\

Name: {group}\Удалить игру; Filename: {uninstallexe}

Name: {commondesktop}\Смерть шпионам.Момент истины; Filename: {app}\Smersh.exe; WorkingDir: {app}\; Check: MakeDesktopIcon



[UninstallDelete]

Name: {app}\*; Type: filesandordirs



[_Code_]

type

TGUID = record

Data1: Cardinal;

Data2,

Data3: Word;

Data4: array [0..8] of char;

end;



function GenerateGUID(var GUID: TGUID): Cardinal; external 'GenerateGUID@files:GameuxInstallHelper.dll stdcall setuponly';

function AddToGameExplorer(Binary: String; Path: String; InstallType: Integer; var GUID: TGUID): Cardinal; external 'AddToGameExplorerA@files:GameuxInstallHelper.dll stdcall setuponly';

function CreateTask(InstallType: Integer; var GUID: TGUID; TaskType: Integer; TaskNumber: Integer; TaskName: String; Binary: String; Parameters: String): Cardinal; external 'CreateTaskA@files:GameuxInstallHelper.dll stdcall setuponly';

function RetrieveGUIDForApplication(Binary: String; var GUID: TGUID): Cardinal; external 'RetrieveGUIDForApplicationA@{app}\Uninstall\GameuxInstallHelper.dll stdcall uninstallonly';

function RemoveFromGameExplorer(var GUID: TGUID): Cardinal; external 'RemoveFromGameExplorer@{app}\Uninstall\GameuxInstallHelper.dll stdcall uninstallonly';

function RemoveTasks(var GUID: TGUID): Cardinal; external 'RemoveTasks@{app}\Uninstall\GameuxInstallHelper.dll stdcall uninstallonly';



const

PlayTask = 0;

SupportTask = 1;



var

NeedSize:Integer;

FreeMB, TotalMB: Cardinal;

NeedSpaceLabel,FreeSpaceLabel: TLabel;

DesktopIcon, DirectX: TCheckBox;

GUID: TGUID;

ProgressBar1: TNewProgressBar;

/////Вычисление свободного места на диске

procedure GetFreeSpaceCaption(Sender: TObject);

var

Path: String;

begin

Path := ExtractFileDrive(WizardForm.DirEdit.Text);

GetSpaceOnDisk(Path, True, FreeMB, TotalMB);

if FreeMB > 1024 then

FreeSpaceLabel.Caption := 'Доступно места на диске: '+ FloatToStr(round(FreeMB/1024*100)/100) + ' GB' else

FreeSpaceLabel.Caption := 'Доступно места на диске: '+ IntToStr(FreeMB)+ ' MB';

if FreeMB < NeedSize then

WizardForm.NextButton.Enabled := False else

WizardForm.NextButton.Enabled := True; end;



procedure animateprogress;

begin ProgressBar1.Position := ProgressBar1.Position+1

end;



procedure GetNeedSpaceCaption; /////Вычисление требуемого места для установки

begin

if NeedSize > 1024 then

NeedSpaceLabel.Caption := 'Требуется места на диске: '+ FloatToStr(round(NeedSize/1024*100)/100) + ' GB' else

NeedSpaceLabel.Caption := 'Требуется места на диске: '+ IntToStr(NeedSize)+ ' MB';end;



function MakeDesktopIcon: Boolean;

begin

Result:=DesktopIcon.Checked;end;



function InstallDirectX: Boolean;

begin

Result:=DirectX.Checked;end;



procedure InitializeWizard();

begin

begin

NeedSize := 3210; //Здесь указывается место для приложения

WizardForm.DiskSpaceLabel.Hide;

WizardForm.FilenameLabel.Hide;

WizardForm.ProgressGauge.Top:=ScaleY(100); //Изменение стандартного прогрессбара

WizardForm.ProgressGauge.Width:=262; //

WizardForm.ProgressGauge.Left:=155; //

WizardForm.StatusLabel.Top:=ScaleY(80);

WizardForm.WelcomeLabel2.Top:=ScaleY(90);

NeedSpaceLabel := TLabel.Create(WizardForm);

with NeedSpaceLabel do

begin

Parent := WizardForm.SelectDirPage;

Left := ScaleX(0);

Top := ScaleY(202);

Width := ScaleX(209);

Height := ScaleY(13);

end;

end;

FreeSpaceLabel := TLabel.Create(WizardForm);

with FreeSpaceLabel do

begin

Parent := WizardForm.SelectDirPage;

Left := ScaleX(0);

Top := ScaleY(220);

Width := ScaleX(209);

Height := ScaleY(13);

end;

WizardForm.DirEdit.OnChange := @GetFreeSpaceCaption;

WizardForm.DirEdit.Text := WizardForm.DirEdit.Text + #0;

begin //Создание чекбокса для создания ярлыка на рабочем столе

DesktopIcon := TCheckBox.Create(WizardForm);

with DesktopIcon do

begin

Parent := WizardForm.SelectDirPage;

Caption := 'Добавить ярлык на Рабочий стол';

Left := ScaleX(0);

Top := WizardForm.DirEdit.Top+35;

Width := ScaleX(400);

Height := ScaleY(15);

TabOrder := 0;

Checked := True;

end;

end;

begin //Создание чекбокса для установки DirectX

DirectX := TCheckBox.Create(WizardForm);

with DirectX do

begin

Parent := WizardForm.SelectDirPage;

Caption := 'Установить дополнительное программное обеспечение';

Left := ScaleX(0);

Top := WizardForm.DirEdit.Top+55;

Width := ScaleX(400);

Height := ScaleY(15);

TabOrder := 0;

Checked := True;

end;

end;

begin ///Создание нового прогрессбара

ProgressBar1 := TNewProgressBar.Create(wizardform);

with ProgressBar1 do

begin

Parent := wizardform.installingpage;

Top := 100

Width := 150;

Height := wizardform.progressgauge.height;

Max :=3; //кол-во архивов

end;

end;

end;



procedure CurPageChanged(CurPageID: Integer);

begin

begin

if CurPageID=wpSelectDir then

begin //Тут если Свободное место на диске < требуемого то кнопка "Установвить" на PageSelectDir неактивна

GetNeedSpaceCaption;

if FreeMB < NeedSize then

WizardForm.NextButton.Enabled:=False

WizardForm.NextButton.Caption:='Установить'; //Rename кнопки "Далее" на SelectDir

end;

end;

end;



procedure CurStepChanged(CurStep: TSetupStep); ///Регистрация в GameExplorer

var

Binary, MainExe: String;

ResultCode:Integer;

begin

if CurStep = ssInstall then //Перед установкой

begin

GenerateGUID(GUID);

ExtractTemporaryFile('arc.exe'); //Извлечение Arc.exe в Temp

if (FileExists(AddBackslash(ExpandConstant('{tmp}')) + 'arc.exe')) and (FileExists(AddBackslash(ExpandConstant('{src}')) + 'data-a.bin')) then

begin

WizardForm.StatusLabel.Caption:='Распаковка файлов...'; //Извлечение из 1-го архива

Exec(ExpandConstant('{tmp}\Arc.exe'), 'x '+AddQuotes(ExpandConstant('{src}\data-a.bin'))+' -y -dp'+AddQuotes(ExpandConstant('{app}')), '', SW_HIDE, ewWaitUntilTerminated, ResultCode);

ProgressBar1.Position := ProgressBar1.Position+1



WizardForm.StatusLabel.Caption:='Распаковка файлов...'; //Извлечение из 2-го архива

Exec(ExpandConstant('{tmp}\Arc.exe'), 'x '+AddQuotes(ExpandConstant('{src}\data-b.bin'))+' -y -dp'+AddQuotes(ExpandConstant('{app}')), '', SW_HIDE, ewWaitUntilTerminated, ResultCode);

ProgressBar1.Position := ProgressBar1.Position+1



WizardForm.StatusLabel.Caption:='Распаковка файлов...'; //Извлечение из 3-го архива

Exec(ExpandConstant('{tmp}\Arc.exe'), 'x '+AddQuotes(ExpandConstant('{src}\data-c.bin'))+' -y -dp'+AddQuotes(ExpandConstant('{app}')), '', SW_HIDE, ewWaitUntilTerminated, ResultCode);

ProgressBar1.Position := ProgressBar1.Position+1



end else begin

MsgBox('Исполняемый файл:' + #13#10#13#10 + (AddBackslash(ExpandConstant('{tmp}')) + 'arc.exe') + #13#10#13#10 + 'не найден. Установка отменена', mbInformation, MB_OK);

Abort;

end;

end;

if CurStep = ssPostInstall then

begin

Binary:=ExpandConstant('{#GDFBinary}');

MainExe:=ExpandConstant('{#MainExe}');

AddToGameExplorer(Binary, ExpandConstant('{app}'), 3, GUID);

CreateTask(3, GUID, PlayTask, 0, 'Play', MainExe, '');

end;

end;



function InitializeSetup(): Boolean;

var

UnStr: String;

ErrorCode, Mesages: Integer;

begin //Повторный запуск

Result := True;

if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\Smersh2_is1', 'UninstallString', UnStr) then

begin

If UnStr '' then

begin

Mesages := MsgBox('Смерть шпионам.Момент истины уже установлена в Вашей системе.'+#10#10+'Хотите удалить приложение?', mbInformation, MB_YESNOCANCEL);

case Mesages of

idYes:

begin

UnStr := RemoveQuotes(UnStr);

Exec(UnStr, '/silent', '', SW_Show, ewWaitUntilTerminated, ErrorCode);

Result := True;

end

idNo:

begin

Result := True;

end

idCancel:

begin

Result := False;

end;

end;

end;

end;

end;



procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);

var

ResultStr:String;

Binary: String;

GUID: TGUID;

begin /////////////////////////////////////////Удаление игровых сохранений

if CurUninstallStep=usPostUninstall then

begin

RegQueryStringValue(HKLM, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\Smersh2_is1', 'UnInstConfirm', ResultStr)

if DirExists(ExpandConstant('{userdocs}')+'\smersh') then

if MsgBox('Удалить сохраненные игры и настройки?',mbconfirmation, mb_YesNo) = IDYES then

begin

if not DelTree(ExpandConstant('{userdocs}')+'\Smersh', True, True, True)

then

MsgBox('Папка не удалена!' #13#13 'Папка не существует или задействована.', mbError, MB_OK);

end;

end;

begin

if CurUninstallStep=usUninstall then //Удаление из GameExplorer

begin

Binary:=ExpandConstant('{#GDFBinary}');

RetrieveGUIDForApplication(Binary, GUID);

RemoveFromGameExplorer(GUID);

RemoveTasks(GUID);

UnloadDll(ExpandConstant('{app}\Uninstall\GameuxInstallHelper.dll'));

end;

end;

end;

через joins script ни как
Ответить

Вернуться в «Автоматическая установка приложений»