Ru-Board.club
← Вернуться в раздел «Программы»

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

Автор: IIaBeJl
Дата сообщения: 15.02.2012 17:19
Доброго времени суток всем!

Есть задача - номер версии, который будет показываться в инсталляторе брать с файла, который будет лежать возле него. То есть при запуске инсталлятора он заглядывает в файл (допустим .ini) и устанавливает версию, которая будет показываться пользователю, с него.

Сделано это для того, чтобы инсталлятор не нужно было перекомпиливать, так как он будет находиться на Linux серваке и никто wine туда ставить не собирается. Файлы, которые он будет устанавливать лежат рядом с ним, т.е. он просто их распаковывает, они не вшиты в инсталлятор.

Судя по тому, что я нарыл в инете можно только препроцессор заставить изменить версию, но он естественно работает во время компиляции.

У кого какие есть предложения?
Автор: alex0413
Дата сообщения: 15.02.2012 18:01
ENERGES
проще уже некуда...
http://rghost.ru/36536032
Автор: ENERGES
Дата сообщения: 15.02.2012 18:10
alex0413
спасибо большое
Автор: R3Pa4eK
Дата сообщения: 15.02.2012 18:27
ENERGES
[more=Лови]
#define MyAppName "Brink"

//Пакеры
#define ArcExtract
#define ZipExtract
#define SrepExtract
;#define PrecompExtract
;#define OggDecode

//Максимальное количество архивов в первом прогресс-баре
#define MAX "7"

//Место на диске
#define TotalNeedSize "8620"
#define NeedSpace "5478"

[Setup]
AppName={#MyAppName}
AppVerName={#MyAppName}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
WizardImageFile=Files\WizardImage.bmp
WizardSmallImageFile=Files\WizardSmallImage.bmp
ShowTasksTreeLines=true
OutputBaseFilename=setup
Compression=lzma2/ultra64
InternalCompressLevel=ultra64
SolidCompression=true
AllowNoIcons=true
SetupIconFile=Files\icon.ico
OutputDir=.\Out

[Languages]
Name: "rus"; MessagesFile: "compiler:Languages\Russian.isl"

[CustomMessages]
rus.FinishedLabel=Программа {#SetupSetting("AppName")} установлена на Ваш компьютер. Приложение можно запустить с помощью соответствующего значка.%n%nНажмите «Завершить», чтобы выйти из программы установки.
rus.FreeSpace=Доступно места на диске:
rus.NeedSpace=Требуется места на диске:
rus.Error=Ошибка распаковки!
rus.Error2=Установка %n{#MyAppName} %nне завершена.
rus.Error3=%nВо время установки произошла ошибка, пожалуйста отключите сторонние программы и повторите попытку установки.%n%n%nНажмите «Завершить», чтобы выйти.
rus.Deletegame=Удалить игру
rus.Launchgame=Запустить игру
rus.Icons=Создать ярлык на рабочем столе
rus.Group=Создать ярлыки в меню "Пуск"
rus.redist=Установить MS Visual C++
rus.DRT=Обновить DirectX
rus.UP=Идет обновление DirectX...
rus.WelcomeLabel1=Программа установит игру %n{#MyAppName} на Вам компьютер.
rus.WelcomeLabel2=Рекомендуется закрыть%n антивирусные пакеты, а%n также все прочие %nприложения перед тем, как%n продолжить.%n%n%nНажмите «Далее», чтобы %nпродолжить,или «Отмена»,%n чтобы выйти из программы %nустановки.
rus.FinisLabel1=Игра %n{#MyAppName}%n установлена на Ваш%n компьютер.
rus.FinisLabel2=%n%nДля ее запуска выберите%n соотвествующий ярлык%n в меню "Пуск" или на Рабочем столе. %n%nНажмите «Завершить», %nчтобы выйти из программы установки.


[Tasks]
//Name: rus; Description: Русский; GroupDescription: Язык игры:; Flags: exclusive
//Name: eng; Description: Английский; GroupDescription: Язык игры:; Flags: exclusive

Name: desktopicon; Description: Создать ярлык на рабочем столе?; GroupDescription: Ярлыки:;
Name: Tasks0; Description: Установить дополнительное программное обеспечения:; Flags: unchecked
Name: Tasks0\Tasks3; Description: Обновить библиотеки &DirectX (требуется интернет соединение); GroupDescription: """Установить дополнительное программное обеспечения:"""
Name: Tasks0\Tasks2; Description: Обновить библиотеки &Microsoft Visual C++ Redist; GroupDescription: """Установить дополнительное программное обеспечения:"""

[Run]
Filename: {src}\Redist\vcredist_x86.exe; StatusMsg: Установка Microsoft Visual C++ Redist; Parameters: /Q; WorkingDir: {src}\Redist; Flags: skipifdoesntexist; Check: PO1;
Filename: {src}\Redist\dxwebsetup.exe; StatusMsg: Обновления DirectX; WorkingDir: {src}\Redist; Flags: skipifdoesntexist; Check: PO1;

[Icons]
Name: {userdesktop}\{#MyAppName}; Filename: {app}\revLoader.exe; IconFilename: {app}\brink.exe; WorkingDir: {app}; Check: MakeDesktopIcon;
Name: {group}\{cm:UninstallProgram,{#MyAppName}}; Filename: {uninstallexe}; IconFilename: {app}\brink.exe; Comment: {cm:Deletegame};
Name: {group}\{#MyAppName}; Filename: {app}\revLoader.exe; IconFilename: {app}\brink.exe; WorkingDir: {app}; Comment: {cm:Launchgame};

[Files]
Source: Files\ISExec.dll; Flags: dontcopy
Source: Files\papka.bmp; DestDir: "{tmp}"; Flags: dontcopy
Source: Files\bass.dll; DestDir: "{tmp}"; Flags: dontcopy noencryption
Source: Files\Music.mp3; DestDir: "{tmp}"; Flags: dontcopy
Source: Files\MusicButton.bmp; DestDir: "{tmp}"; Flags: dontcopy
Source: Files\panel.bmp; DestDir: "{tmp}"; Flags: dontcopy
Source: Files\iswin7.dll; Flags: dontcopy
Source: Files\fairy.dll; Flags: dontcopy
Source: Files\logo.png; Flags: dontcopy

//Файлы для распаковки
#ifdef ArcExtract
Source: "files\unarc.dll"; DestDir: {tmp}; Flags: dontcopy
Source: "files\facompress.dll"; DestDir: {tmp}; Flags: dontcopy
Source: "files\facompress_mt.dll"; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef SrepExtract
Source: "files\srep.dll"; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef ZipExtract
Source: "files\7z.dll"; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef PrecompExtract
Source: "files\precomp.dll"; DestDir: {tmp}; Flags: dontcopy
Source: "files\packjpg_dll.dll"; DestDir: {tmp}; Flags: dontcopy
Source: "files\zlib1.dll"; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef OggDecode
Source: "files\oggdec.dll"; DestDir: {tmp}; Flags: dontcopy
#endif

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

[code]
const
Color=clwhite;
BASS_ACTIVE_PLAYING = 1;
BASS_ACTIVE_STALLED = 2;
BASS_ACTIVE_PAUSED = 3;
BASS_SAMPLE_LOOP = 4;

//******************************************* [ начало Место для установки ] ***************************************************//
var
SizeStr: String;
SizeInt: Integer;
SymbolNumber: Integer;
FreeMB, TotalMB: Cardinal;
NeedSpace1,NeedSize, TotalNeedSize:Integer;
SL, TotalNeedSpaceLabel, NeedSpaceLabel, FreeSpaceLabel: TLabel;
Group, LogoLabel: TLabel;
LogoPanel:TPanel;
LogoImage:TBitmapImage;
TDV: TFolderTreeView;
TFV: TStartMenuFolderTreeView;
mp3Handle: HWND;
mp3Name: String;
PlayButton, PauseButton, StopButton: TPanel;
PlayImage, PauseImage: TBitmapImage;
PlayLabel, PauseLabel: TLabel;
MouseLabel: Tlabel;
Panel: TBitmapImage;
GifFrameCount: Integer;
S1: AnsiString;
DesktopIcon, PO: TCheckBox;


Function NumToStr(Float: Extended): String;
Begin
Result:= Format('%.2n', [Float]); StringChange(Result, ',', '.');
while ((Result[Length(Result)] = '0') or (Result[Length(Result)] = '.')) and (Pos('.', Result) > 0) do
SetLength(Result, Length(Result)-1);
End;

Function MbOrTb(Byte: Extended): String;
begin
if Byte < 1024 then Result:= NumToStr(Byte) + ' Мб' else
if Byte/1024 < 1024 then Result:= NumToStr(round(Byte/1024*100)/100) + ' Гб' else
Result:= NumToStr(round((Byte/(1024*1024))*100)/100) + ' Тб'
end;

procedure GetFreeSpaceCaption(Sender: TObject);
var Path: String;
begin
Path := ExtractFileDrive(WizardForm.DirEdit.Text);
GetSpaceOnDisk(Path, True, FreeMB, TotalMB);
TotalNeedSpaceLabel.Caption := 'Для установки требуется: '+ MbOrTb(TotalNeedSize);
FreeSpaceLabel.Caption := 'Размер жесткого диска: '+ MbOrTb(FreeMB);
NeedSpaceLabel.Caption := 'Игра займет на диске: '+ MbOrTb(NeedSpace1);
WizardForm.NextButton.Enabled:= (FreeMB>TotalNeedSize);
if (FreeMB<TotalNeedSize) then
FreeSpaceLabel.Font.Color:=clRed else
FreeSpaceLabel.Font.Color:=WizardForm.Font.Color;
end;

function BASS_Init(device: Integer; freq, flags: DWORD; win: hwnd; CLSID: Integer): Boolean; external 'BASS_Init@files:BASS.dll stdcall delayload';
function BASS_StreamCreateFile(mem: BOOL; f: PAnsiChar; offset: DWORD; length: DWORD; flags: DWORD): DWORD; external 'BASS_StreamCreateFile@files:BASS.dll stdcall delayload';
function BASS_Start(): Boolean; external 'BASS_Start@files:BASS.dll stdcall delayload';
function BASS_ChannelPlay(handle: DWORD; restart: BOOL): Boolean; external 'BASS_ChannelPlay@files:BASS.dll stdcall delayload';
function BASS_ChannelIsActive(handle: DWORD): Integer; external 'BASS_ChannelIsActive@files:BASS.dll stdcall delayload';
function BASS_ChannelPause(handle: DWORD): Boolean; external 'BASS_ChannelPause@files:BASS.dll stdcall delayload';
function BASS_Stop(): Boolean; external 'BASS_Stop@files:BASS.dll stdcall delayload';
function BASS_Pause(): Boolean; external 'BASS_Pause@files:BASS.dll stdcall delayload';
function BASS_Free(): Boolean; external 'BASS_Free@files:BASS.dll stdcall delayload';
procedure iswin7_add_glass(Handle:HWND; Left, Top, Right, Bottom : Integer; GDIPLoadMode: boolean); external 'iswin7_add_glass@files:iswin7.dll stdcall';
procedure iswin7_add_button(Handle:HWND); external 'iswin7_add_button@files:iswin7.dll stdcall';
procedure iswin7_free; external 'iswin7_free@files:iswin7.dll stdcall';

procedure PlayMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
PlayImage.Left := -60
end;

procedure PlayMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
PlayImage.Left := 0
end;

procedure PlayMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
if PlayImage.Left <> -60 then PlayImage.Left := -120
end;

procedure PlayMouseLeave(Sender: TObject);
begin
PlayImage.Left := 0
PauseImage.Left := -20
end;

procedure PauseMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
PauseImage.Left := -80
end;

procedure PauseMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
PauseImage.Left := -20
end;

procedure PauseMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
if PauseImage.Left <> -80 then PauseImage.Left := -140
end;

procedure PauseMouseLeave(Sender: TObject);
begin
PlayImage.Left := 0
PauseImage.Left := -20
end;

procedure PlayButtonOnClick(Sender: TObject);
begin
case BASS_ChannelIsActive(mp3Handle) of
BASS_ACTIVE_PAUSED:
begin
BASS_ChannelPlay(mp3Handle, False);
PlayButton.Hide;
PauseButton.Show;
end;
end;
end;

procedure PauseButtonOnClick(Sender: TObject);
begin
BASS_ChannelPause(mp3Handle);
PauseButton.Hide;
PlayButton.Show;
end;

procedure InitializeMusic();
begin
ExtractTemporaryFile('MusicButton.bmp');

PlayButton := TPanel.Create(WizardForm);
PlayButton.Left := 470;
PlayButton.Top := 70;
PlayButton.Width := 20;
PlayButton.Height := 20;
PlayButton.Cursor := crHand;
PlayButton.Parent := WizardForm;

PlayImage := TBitmapImage.Create(WizardForm);
PlayImage.Left := 0;
PlayImage.Top := 0;
PlayImage.Width := 173;
PlayImage.Height := 20;
PlayImage.Enabled := False;
PlayImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\MusicButton.bmp'));
PlayImage.Parent := PlayButton;
PlayImage.ReplaceColor:=clBtnFace;
PlayImage.ReplaceWithColor:=clwhite;

PlayLabel := TLabel.Create(WizardForm);
PlayLabel.Width := PlayButton.Width;
PlayLabel.Height := PlayButton.Height;
PlayLabel.Autosize := False;
PlayLabel.Transparent := True;
PlayLabel.OnClick := @PlayButtonOnClick;
PlayLabel.OnMouseDown := @PlayMouseDown;
PlayLabel.OnMouseUp := @PlayMouseUp;
PlayLabel.OnMouseMove := @PlayMouseMove;
PlayLabel.OnMouseLeave := @PlayMouseLeave;
PlayLabel.Parent := PlayButton;

PauseButton := TPanel.Create(WizardForm);
PauseButton.Left := 470;
PauseButton.Top := 70;
PauseButton.Width := 20;
PauseButton.Height := 20;
PauseButton.Cursor := crHand;
PauseButton.Parent := WizardForm;

PauseImage := TBitmapImage.Create(WizardForm);
PauseImage.Left := -20;
PauseImage.Top := 0;
PauseImage.Width := 173;
PauseImage.Height := 20;
PauseImage.Enabled := False;
PauseImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\MusicButton.bmp'));
PauseImage.Parent := PauseButton;
PauseImage.ReplaceColor:=$e2e2e2;
PauseImage.ReplaceWithColor:=clwhite;

PauseLabel := TLabel.Create(WizardForm);
PauseLabel.Width := PauseButton.Width;
PauseLabel.Height := PauseButton.Height;
PauseLabel.Autosize := False;
PauseLabel.Transparent := True;
PauseLabel.OnClick := @PauseButtonOnClick;
PauseLabel.OnMouseDown := @PauseMouseDown;
PauseLabel.OnMouseUp := @PauseMouseUp;
PauseLabel.OnMouseMove := @PauseMouseMove;
PauseLabel.OnMouseLeave := @PauseMouseLeave;
PauseLabel.Parent := PauseButton;
end;

Procedure CurPageMusicChanged(CurPageID: Integer);
Begin
case CurPageID of
wpWelcome:
begin
PlayButton.Hide;
PauseButton.Hide;
end;
wpSelectDir:
begin
if BASS_ChannelIsActive(mp3Handle) = BASS_ACTIVE_PAUSED then
PlayButton.Show else
PauseButton.Show;
end;
wpFinished:
begin
PlayButton.Hide;
PauseButton.Hide;
end;
end;
end;

procedure TDVOnChange(Sender: TObject);
begin
WizardForm.DirEdit.Text:= AddBackslash(TDV.Directory)+'{#MyAppName}';
end;

procedure TFVOnChange(Sender: TObject);
begin
WizardForm.GroupEdit.Text:= AddBackslash(TFV.Directory)+'{#MyAppName}';
end;

procedure ISWin7();
begin
iswin7_add_button(WizardForm.BackButton.Handle);
iswin7_add_button(WizardForm.NextButton.Handle);
iswin7_add_button(WizardForm.CancelButton.Handle);
iswin7_add_glass(WizardForm.Handle, 0, 0, 0, 47, True);
end;

function MakeDesktopIcon: Boolean;
begin
Result:=DesktopIcon.Checked;
end;

function PO1: Boolean;
begin
Result:=PO.Checked;
end;

procedure DerevoDiskov();
begin
ExtractTemporaryFile('BASS.dll');
ExtractTemporaryFile('music.mp3');
mp3Name := ExpandConstant('{tmp}\music.mp3');
BASS_Init(-1, 44100, 0, 0, 0);
mp3Handle := BASS_StreamCreateFile(FALSE, PAnsiChar(mp3Name), 0, 0, BASS_SAMPLE_LOOP);
BASS_Start();
BASS_ChannelPlay(mp3Handle, False);
end;

procedure NeedSpace();
begin
WizardForm.DiskSpaceLabel.Hide;
TotalNeedSize := {#TotalNeedSize};
NeedSpace1:={#NeedSpace}
FreeSpaceLabel := TLabel.Create(WizardForm);
FreeSpaceLabel.Parent := WizardForm.SelectDirPage;
FreeSpaceLabel.SetBounds(ScaleX(5), ScaleY(165), ScaleX(209), ScaleY(13));
FreeSpaceLabel.Transparent:=true;

TotalNeedSpaceLabel := TLabel.Create(WizardForm);
TotalNeedSpaceLabel.Parent := WizardForm.SelectDirPage;
TotalNeedSpaceLabel.SetBounds(ScaleX(5), ScaleY(185), ScaleX(209), ScaleY(13));
TotalNeedSpaceLabel.Transparent:=true;

NeedSpaceLabel := TLabel.Create(WizardForm);
NeedSpaceLabel.Parent := WizardForm.SelectDirPage;
NeedSpaceLabel.SetBounds(ScaleX(5), ScaleY(205), ScaleX(209), ScaleY(13));
NeedSpaceLabel.Transparent:=true;

WizardForm.DirEdit.OnChange:= @GetFreeSpaceCaption;
WizardForm.DirEdit.Text:= WizardForm.DirEdit.Text + #0;
end;

procedure CurPageChanged3(CurPageID: Integer);
begin
if CurPageID = wpSelectDir then begin
GetFreeSpaceCaption(nil)
end;
end;

function ShouldSkipPage(PageID: Integer): Boolean;
begin
if (PageID =wpSelectTasks) or (PageID =wpReady) then
Result:= True;
end;

//******************************************* [ конец Место для установки ] ***************************************************//
//***********Подключения модулей***************//
#include "Iss\logo.iss"
//***********Подключения модулей***************//
var
PageNameLabel, PageDescriptionLabel, WelcomeLabel1,WelcomeLabel2,FLabel1, FLabel2, WLabel1, WLabel2, WelcomeLabel4,FinishedHeadingLabel, FinishedHeadingLabel1,WelcomeLabel3: TLabel;
//**************************//Начало растяжения WizardImage//******************************************//
procedure WizardImage();
begin
WizardForm.WizardBitmapImage.Width:= ScaleX(497);
WizardForm.WizardBitmapImage2.Width:= ScaleX(497);

WelcomeLabel1:= TLabel.Create(WizardForm);
WelcomeLabel1.Left := ScaleX(276);
WelcomeLabel1.Top := ScaleY(89);
WelcomeLabel1.Width := ScaleX(205);
WelcomeLabel1.Height := ScaleY(219);
WelcomeLabel1.AutoSize := False;
WelcomeLabel1.WordWrap := True;
WelcomeLabel1.Alignment := taCenter;
WelcomeLabel1.Font.Size := 8;
WelcomeLabel1.Font.Color:= clblack;
WelcomeLabel1.Font.Style:= [fsBold]
WelcomeLabel1.Font.Name:= 'Georgia'
WelcomeLabel1.ShowAccelChar := False;
WelcomeLabel1.Caption :=ExpandConstant('{cm:WelcomeLabel1}');
WelcomeLabel1.Transparent := True;
WelcomeLabel1.Parent := WizardForm.WelcomePage;

WLabel1 := TLabel.Create(WizardForm);
WLabel1.Left := ScaleX(275);
WLabel1.Top := ScaleY(90);
WLabel1.Width := ScaleX(205);
WLabel1.Height := ScaleY(219);
WLabel1.AutoSize := False;
WLabel1.WordWrap := True;
WLabel1.Alignment := taCenter;
WLabel1.Font.Size := 8;
WLabel1.Font.Color:= clwhite;
WLabel1.Font.Style:= [fsBold]
WLabel1.Font.Name:= 'Georgia'
WLabel1.ShowAccelChar := False;
WLabel1.Caption :=ExpandConstant('{cm:WelcomeLabel1}');
WLabel1.Transparent := True;
WLabel1.Parent := WizardForm.WelcomePage;

WelcomeLabel2:= TLabel.Create(WizardForm);
WelcomeLabel2.Left := ScaleX(272);
WelcomeLabel2.Top := ScaleY(150);
WelcomeLabel2.Width := ScaleX(210);
WelcomeLabel2.Height := ScaleY(234);
WelcomeLabel2.AutoSize := False;
WelcomeLabel2.WordWrap := True;
WelcomeLabel2.Alignment := taCenter;
WelcomeLabel2.Font.Size := 8;
WelcomeLabel2.Font.Color:= clblack;
WelcomeLabel2.Font.Style:= [fsBold]
WelcomeLabel2.Font.Name:= 'Georgia'
WelcomeLabel2.ShowAccelChar := False;
WelcomeLabel2.Caption :=ExpandConstant('{cm:WelcomeLabel2}');
WelcomeLabel2.Transparent := True;
WelcomeLabel2.Parent := WizardForm.WelcomePage;

WLabel2 :=TLabel.Create(WizardForm);
WLabel2.Top := ScaleY(149);
WLabel2.Left := ScaleX(271);
WLabel2.Width := ScaleX(210);
WLabel2.Height := ScaleY(234);
WLabel2.AutoSize := False;
WLabel2.WordWrap := True;
WLabel2.Alignment := taCenter;
WLabel2.Font.Size := 8;
WLabel2.Font.Style:= [fsBold]
WLabel2.Font.Color:= clwhite;
WLabel2.Font.Name:= 'Georgia'
WLabel2.ShowAccelChar := False;
WLabel2.Caption := ExpandConstant('{cm:WelcomeLabel2}');
WLabel2.Transparent := True;
WLabel2.Parent := WizardForm.WelcomePage;

FinishedHeadingLabel:= TLabel.Create(WizardForm);
FinishedHeadingLabel.Left := ScaleX(271);
FinishedHeadingLabel.Top := ScaleY(91);
FinishedHeadingLabel.Width := ScaleX(210);
FinishedHeadingLabel.Height := ScaleY(100);
FinishedHeadingLabel.AutoSize := False;
FinishedHeadingLabel.WordWrap := True;
FinishedHeadingLabel.Alignment := taCenter;
FinishedHeadingLabel.Font.Size := 8;
FinishedHeadingLabel.Font.Color:= clblack;
FinishedHeadingLabel.Font.Style:= [fsBold]
FinishedHeadingLabel.Font.Name:= 'Georgia'
FinishedHeadingLabel.ShowAccelChar := False;
FinishedHeadingLabel.Caption :=ExpandConstant('{cm:FinisLabel1}');
FinishedHeadingLabel.Transparent := True;
FinishedHeadingLabel.Parent := WizardForm.FinishedPage;

FLabel1 := TLabel.Create(WizardForm);
FLabel1.Left := ScaleX(270);
FLabel1.Top := ScaleY(90);
FLabel1.Width := ScaleX(210);
FLabel1.Height := ScaleY(100);
FLabel1.AutoSize := False;
FLabel1.Alignment := taCenter;
FLabel1.WordWrap := True;
FLabel1.Font.Size := 8;
FLabel1.Font.Name := 'Georgia'
FLabel1.Font.Color:= clwhite;
FLabel1.Font.Style:= [fsBold]
FLabel1.ShowAccelChar := False;
FLabel1.Caption := ExpandConstant('{cm:FinisLabel1}');
FLabel1.Transparent := True;
FLabel1.Parent := WizardForm.FinishedPage;

FinishedHeadingLabel1:= TLabel.Create(WizardForm);
FinishedHeadingLabel1.Left := ScaleX(271);
FinishedHeadingLabel1.Top := ScaleY(149);
FinishedHeadingLabel1.Width := ScaleX(210);
FinishedHeadingLabel1.Height := ScaleY(234);
FinishedHeadingLabel1.AutoSize := False;
FinishedHeadingLabel1.WordWrap := True;
FinishedHeadingLabel1.Alignment := taCenter;
FinishedHeadingLabel1.Font.Size := 8;
FinishedHeadingLabel1.Font.Color:= clblack;
FinishedHeadingLabel1.Font.Style:= [fsBold]
FinishedHeadingLabel1.Font.Name:= 'Georgia'
FinishedHeadingLabel1.ShowAccelChar := False;
FinishedHeadingLabel1.Caption :=ExpandConstant('{cm:FinisLabel2}');
FinishedHeadingLabel1.Transparent := True;
FinishedHeadingLabel1.Parent := WizardForm.FinishedPage;

FLabel2 :=TLabel.Create(WizardForm);
FLabel2.Top := ScaleY(150);
FLabel2.Left := ScaleX(270);
FLabel2.Width := ScaleX(210);
FLabel2.Height := ScaleY(234);
FLabel2.AutoSize := False;
FLabel2.WordWrap := True;
FLabel2.Alignment := taCenter;
FLabel2.Font.Size := 8;
FLabel2.Font.Name := 'Georgia'
FLabel2.Font.Style:= [fsBold]
FLabel2.Font.Color:= clwhite;
FLabel2.ShowAccelChar := False;
FLabel2.Caption := ExpandConstant('{cm:FinisLabel2}');
FLabel2.Transparent := True;
FLabel2.Parent := WizardForm.FinishedPage;

WizardForm.WelcomeLabel1.Hide;
WizardForm.WelcomeLabel2.Hide;

WizardForm.FinishedLabel.Hide;
WizardForm.FinishedHeadingLabel.Hide;
end;
//**************************//Конец растяжения WizardImage//******************************************//
//**************************//Начало растяжения WizardSmallImage//******************************************//

procedure WizardSmallImage();
begin
WizardForm.WizardSmallBitmapImage.SetBounds(ScaleX(0), ScaleY(0), WizardForm.MainPanel.Width, WizardForm.MainPanel.Height);

PageNameLabel:= TLabel.Create(WizardForm)
with WizardForm.PageNameLabel do
PageNameLabel.SetBounds(Left, Top, Width, Height);
PageNameLabel.Transparent:= True;
PageNameLabel.Font:= WizardForm.PageNameLabel.Font;
PageNameLabel.Font.Color:= clblack;
PageNameLabel.Parent:= WizardForm.MainPanel;

PageDescriptionLabel:= TLabel.Create(WizardForm);
with PageDescriptionLabel do
begin
Left:= WizardForm.PageDescriptionLabel.Left-12;
Top:= WizardForm.PageDescriptionLabel.Top;
Height:= WizardForm.PageDescriptionLabel.Height;
Width:= ScaleX(280);
AutoSize:= False;
WordWrap:= True;
Font.Name:= WizardForm.PageDescriptionLabel.Font.Name;
Transparent:= True;
Parent:= WizardForm.MainPanel;
end;

WizardForm.PageNameLabel.Hide;
WizardForm.PageDescriptionLabel.Hide;
end;
//**************************//Конец растяжения WizardSmallImage//******************************************//
//************************************************ [Начало - Вн. вид инсталла] ***************************************************//
procedure RepaintInstall();
begin
ExtractTemporaryFile('papka.bmp');
WizardForm.Font.Color:=clblack;
WizardForm.Color:=Color;
WizardForm.WelcomePage.Color:=Color;
WizardForm.InnerPage.Color:=Color;
WizardForm.FinishedPage.Color:=Color;
WizardForm.SelectDirPage.Color:=Color;
WizardForm.SelectComponentsPage.Color:=Color;
WizardForm.SelectProgramGroupPage.Color:=Color;
WizardForm.SelectTasksPage.Color:=Color;
WizardForm.ReadyPage.Color:=Color;
WizardForm.InstallingPage.Color:=Color;

WizardForm.PageNameLabel.Color:=Color;
WizardForm.PageNameLabel.Font.Color:=clblack;
WizardForm.MainPanel.Color:=Color;

WizardForm.SelectDirLabel.Color:=Color;
WizardForm.SelectDirBrowseLabel.Color:=Color;
WizardForm.DirEdit.Color:=Color;
WizardForm.DiskSpaceLabel.Color:=Color;

WizardForm.ComponentsList.Color:=Color;
WizardForm.SelectComponentsLabel.Color:=Color;
WizardForm.TypesCombo.Hide;
WizardForm.ComponentsDiskSpaceLabel.Hide;

WizardForm.GroupEdit.Color:=Color;
WizardForm.SelectStartMenuFolderLabel.Color:=Color;
WizardForm.SelectStartMenuFolderBrowseLabel.Color:=Color;

WizardForm.SelectTasksLabel.Color:=Color;
WizardForm.TasksList.Color:=Color;

WizardForm.ReadyMemo.Color:=Color;
WizardForm.ReadyMemo.ScrollBars:= ssNone
WizardForm.ReadyLabel.Color:=Color;

WizardForm.StatusLabel.Color:=Color;
WizardForm.FilenameLabel.Color:=Color;
WizardForm.SelectDirBitmapImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\papka.bmp'));
WizardForm.SelectDirBitmapImage.AutoSize:=true;
WizardForm.SelectGroupBitmapImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\papka.bmp'));
WizardForm.SelectGroupBitmapImage.AutoSize:=true;

Panel := TBitmapImage.Create(WizardForm)
with Panel do
begin
ExtractTemporaryFile('panel.bmp');
Bitmap.LoadFromFile(ExpandConstant('{tmp}\panel.bmp'));
Parent := WizardForm.SelectDirPage;
Left := 0;
Top := 157;
Width :=273;
Height :=68;
end;

DesktopIcon := TCheckBox.Create(WizardForm);
with DesktopIcon do
begin
Parent := WizardForm.SelectDirPage;
Caption := 'Создать ярлык на Рабочем столе';
Left := ScaleX(0);
Top := ScaleY(110);
Width := ScaleX(200);
Height := ScaleY(15);
Font.Name:= WizardForm.Font.Name;
Cursor:= crHand;
Checked := true;
end;

PO := TCheckBox.Create(WizardForm);
with PO do
begin
Parent := WizardForm.SelectDirPage;
Caption := 'Установить дополнительное програмное обеспечения';
Left := ScaleX(0);
Top := ScaleY(133);
Width := ScaleX(300);
Height := ScaleY(15);
Font.Name:= WizardForm.Font.Name;
Cursor:= crHand;
Checked := False;
end;
end;

//************************************************ [Конец - Вн. вид инсталла] ***************************************************//
//************************************************[Начало руссофобия]*************************************************************//
const
A1='А';
Z1='Я';
A2='а';
Z2='я';
X1='ё';
X2='Ё';
function NextButtonClick(CurPageID: Integer): Boolean;
var i: integer;
c: char;
begin
Result := True;
if CurPageID = wpSelectDir then begin
for i:=1 to length(WizardForm.DirEdit.text) do begin
c:=WizardForm.DirEdit.text[i];
if (c>=A1)and(c<=Z1) or (c>=A2)and(c<=Z2) or (c=X1) or (c=X2) then begin
MsgBox( 'В пути установки присутствуют русские буквы, что недопустимо'#13#13'Пожалуйста, повторите ввод.', mbError, mb_Ok);
Result := False ;
exit;
end;
end;
end;
end;
//************************************************[Конец руссофобия]*************************************************************//
//************************************ [ начало logo - Лого как ссылка внизу слева ] ***************************************//
procedure logo();
begin
InitFairy(WizardForm.Handle, 0, 30);
ExtractTemporaryFile('logo.png');
AddImgToList(7, 345, 255, clnone, ExpandConstant('{tmp}\logo.png'))
ShowFairyEx(0);
end;
//************************************ [ конец logo - Лого как ссылка внизу слева ] ***************************************//
//******************************************* [Начало - Прогрессбар и леблы] ***************************************************//
var
isexec_cancel: boolean;
ProgressBar1:TNewProgressBar;
n: Integer;

procedure InitializeWizard1();
begin
WizardForm.ProgressGauge.Hide;
with WizardForm do
begin
FileNameLabel.Hide;
StatusLabel.Top:=20;
end;

isexec_cancel := true;

ProgressBar1:=TNewProgressBar.Create(WizardForm);
with ProgressBar1 do
begin
Parent := WizardForm.InstallingPage;
Left := 0
Top := WizardForm.ProgressGauge.Top;
Width := WizardForm.ProgressGauge.Width;
Height := 21
Min := 0;
Max :={#MAX};
end;
end;
//******************************************* [Конец - Прогрессбар и леблы] ***************************************************//
//******************************************* [Начало - Работы распаковщика] ***************************************************//

var
Cancel:integer;

type
TISCreateProcessCallback = function(): boolean;

function CreateProcess(callback: TISCreateProcessCallback; EXEName: PAnsiChar; DIRName: PAnsiChar; Show: boolean; Comfort: boolean; hWnd: HWND): BOOL; external 'isexec_cp@files:ISExec.dll stdcall';

function ISCreateProcessCallback(): boolean;
begin
Result := isexec_cancel; // вернёш False прервеш запуск
begin
if not(isexec_cancel) then
begin
ProgressBar1.Hide;
WizardForm.ProgressGauge.Hide;
WizardForm.StatusLabel.Caption:='Откат установки...';
DelTree(ExpandConstant('{app}'), True, True, True); /// удаление временных файлов при отмене (если файл занят то он останется)
end;
end;
end;
//**********************************************[Поиск по маске]
var
Files: Array of String;
S: String;

Function StringToArray(Text, Cut: String): array of String; var i, k: Integer;
Begin
SetArrayLength(Result, 0); if Cut = '' then Cut:= #1310; //если шаблон пуст, считаем переводы строк
Repeat k:= Pos(Cut,Text);
if k = 1 then begin Delete(Text, 1, Length(Cut)); CONTINUE
end;
SetArrayLength(Result, GetArrayLength(Result) +1); i:= GetArrayLength(Result) -1;
if k = 0 then
Result[i]:=Text
else begin
Result[i]:= Copy(Text, 1, k -1); Delete(Text, 1, Length(Result[i]) + Length(Cut));
end;
Until Length(Text) * k = 0;
End;

procedure FindFiles(FromDir: String; Mask: String);
var FSR, DSR: TFindRec; FindResult: Boolean;
begin
FindResult:= FindFirst(AddBackslash(FromDir)+Mask, FSR)
while FindResult do begin
if FSR.Attributes and FILE_ATTRIBUTE_DIRECTORY = 0 then begin
S:= S + AddBackslash(fromDir) + FSR.Name +'|';
end;
FindResult:= FindNext(FSR);
end;
FindResult:= FindFirst(AddBackslash(FromDir)+ '*.*', DSR)
while FindResult do begin
if ((DSR.Attributes and FILE_ATTRIBUTE_DIRECTORY) = FILE_ATTRIBUTE_DIRECTORY) and not ((DSR.Name = '.') or (DSR.Name = '..')) then begin
FindFiles(AddBackSlash(FromDir)+DSR.Name, Mask)
end;
FindResult:= FindNext(DSR);
end;
FindClose(FSR); FindClose(DSR)
end;
//**********************************************[конец поиск по маске]
//**********************************************[распаковка ogg]
procedure OggDecode;
var ResultCode: integer; CurFile: String;
begin

FindFiles(ExpandConstant('{app}'), '*.ogg') //Находим все файлы по маске, в выбранной папке
Files:= StringToArray(S, '|') //Переводим в массив

for n:=(GetArrayLength(Files)-1) downto 0 do begin

CurFile:= Files[n]
StringChange(CurFile, AddBackslash(ExtractFilePath(Files[n])), '')

if not(CreateProcess(@ISCreateProcessCallback, ExpandConstant('{tmp}\oggdec.dll') + ' ' + ' -Q '+ CurFile, AddBackslash(ExtractFilePath(Files[n])), FALSE, FALSE, WizardForm.Handle)) then exit;

ProgressBar1.Position:= ProgressBar1.Position +1;
DeleteFile(Files[n]) //Удаляем ненужный файл
end;
end;
//**********************************************[конец распаковки ogg]
//**********************************************[распаковка pcf]
procedure PcfDecode;
var ResultCode: integer; CurFile: String;
begin

FindFiles(ExpandConstant('{app}'), '*.pcf') //Находим все файлы по маске, в выбранной папке
Files:= StringToArray(S, '|') //Переводим в массив

for n:=(GetArrayLength(Files)-1) downto 0 do begin

CurFile:= Files[n]
StringChange(CurFile, AddBackslash(ExtractFilePath(Files[n])), '')

if not(CreateProcess(@ISCreateProcessCallback, ExpandConstant('{tmp}\precomp.dll') + ' ' + ' -r '+ CurFile, AddBackslash(ExtractFilePath(Files[n])), FALSE, FALSE, WizardForm.Handle)) then exit;

ProgressBar1.Position:= ProgressBar1.Position +1;
DeleteFile(Files[n]) //Удаляем ненужный файл
end;
end;
//**********************************************[конец распаковки pcf]
//**********************************************[распаковка arc]
procedure ArcExtract(arcArchName,arcDestDir: string);
begin
if not(CreateProcess(@ISCreateProcessCallback, ExpandConstant('{tmp}\unarc.dll') + ' ' + 'x '+AddQuotes(ExpandConstant(arcArchName))+' -y -dp'+AddQuotes(ExpandConstant(arcDestDir)), '', FALSE, FALSE, WizardForm.Handle)) then exit;
ProgressBar1.Position:= ProgressBar1.Position +1;
end;
//**********************************************[конец распаковки arc]
//**********************************************[распаковка 7z]
procedure ZipExtract(zipArchName,zipDestDir: string);
begin
if not(CreateProcess(@ISCreateProcessCallback, ExpandConstant('{tmp}\7z.dll') + ' ' + 'x '+AddQuotes(ExpandConstant(zipArchName))+' -y -o'+AddQuotes(ExpandConstant(zipDestDir)), '', FALSE, FALSE, WizardForm.Handle)) then exit;
ProgressBar1.Position:= ProgressBar1.Position +1;
end;
//**********************************************[конец распаковки 7z]
//**********************************************[распаковка srep]
procedure SrepExtract(srepArchName,srepDestDir: string);//srep
begin
if not(CreateProcess(@ISCreateProcessCallback, ExpandConstant('{tmp}\srep.dll') + ' ' + '-d -delete '+AddQuotes(ExpandConstant(srepArchName))+' '+AddQuotes(ExpandConstant(srepDestDir)),'', FALSE, FALSE, WizardForm.Handle)) then exit;
ProgressBar1.Position:= ProgressBar1.Position +1;
end;
//**********************************************[конец распаковки srep]
//**********************************************[разделение на 2 диска]
function NextDisk(num: integer; CheckedFile: string): string;
var Capt:string;
CheckedDir:string;
Cancel:string;
begin
if not(isexec_cancel) then exit;
CheckedFile:=ExpandConstant(CheckedFile);
if not FileExists(CheckedFile) then begin
Capt:=ExpandConstant('{cm:disk}')+' №%n'+ExpandConstant('{cm:disk2}');
StringChange(Capt, '%n', inttostr(num));
StringChange(Capt, '%f', ExtractFileName(CheckedFile));
if MsgBox(Capt, mbConfirmation, MB_OKCANCEL)= IDCANCEL then
WizardForm.Close;
DelTree(ExpandConstant('{app}'), True, True, True);
begin
NextDisk(num, CheckedFile);
end;
Result := CheckedFile;
end;
end;
//**********************************************[конец разделение на 2 диска]


//////////// ТУТ ПРИДЁТСЯ ИСПРАВЛЯТЬ ПОСТОЯННО!!!!!!!!!!!!!
procedure CurStepChanged(CurStep: TSetupStep);
var
i: integer;
tmp:integer;
begin

if CurStep = ssInstall then
begin
WizardForm.StatusLabel.Caption:='Распаковка файлов...';
#ifdef ArcExtract
ExtractTemporaryFile('unarc.dll');
ExtractTemporaryFile('facompress.dll');
ExtractTemporaryFile('facompress_mt.dll');
#endif
#ifdef ZipExtract
ExtractTemporaryFile('7z.dll');
#endif
#ifdef PrecompExtract
ExtractTemporaryFile('precomp.dll');
ExtractTemporaryFile('packjpg_dll.dll');
ExtractTemporaryFile('zlib1.dll');
#endif
#ifdef SrepExtract
ExtractTemporaryFile('srep.dll');
#endif
#ifdef OggDecode
ExtractTemporaryFile('oggdec.dll');
#endif
ProgressBar1.Position := ProgressBar1.Position+1;
end;

if CurStep = ssInstall then
begin
ArcExtract('{src}\data.bin', '{app}');
SrepExtract('{app}\data.tmp', '{app}\data.tar');
ZipExtract('{app}\data.tar', '{app}');
DeleteFile(ExpandConstant('{app}\data.tar'));
ProgressBar1.Position:= ProgressBar1.Position +1;
ArcExtract('{src}\data-a.bin', '{app}');
ArcExtract('{src}\data-b.bin', '{app}');

//SrepExtract('{app}\data.tmp', '{app}\data.tar');
//DeleteFile(ExpandConstant('{app}\data.tmp'));
//ZipExtract('{app}\data.tar', '{app}');
//DeleteFile(ExpandConstant('{app}\data.tar'));

//ArcExtract('{src}\data-a.bin', '{app}');

//NextDisk(2, '{src}\data-3.arc');
//ArcExtract('{src}\data-3.arc', '{app}');



//ArcExtract('{app}\data.arc', '{app}');
//PcfDecode;
//OggDecode;
end;
end;

procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
Confirm:=False;
Cancel:=True;

if CurPageID = wpInstalling then
begin
isexec_cancel := false;
end;
end;

procedure InitializeWizard();
begin
ISWin7();
RepaintInstall();
InitializeMusic();
DerevoDiskov();
WizardImage();
WizardSmallImage();
WizardForm.CancelButton.BringToFront;
InitializeWizard1();
NeedSpace();
logo();

with WizardForm.MainPanel do
begin
Height := ScaleY(74);
end;
end;

procedure CurPageChanged(CurPageID: Integer);
Begin
if CurPageID=wpSelectProgramGroup
then begin
WizardForm.NextButton.Caption:='Установить'
end;
CurPageMusicChanged(CurPageID);
CurPageChanged3(CurPageID);
PageNameLabel.Caption:= WizardForm.PageNameLabel.Caption;
PageDescriptionLabel.Caption:= WizardForm.PageDescriptionLabel.Caption;
end;

procedure DeInitializeSetup();
begin
HideFairy;
UninitFairy;
iswin7_free;
BASS_Stop();
BASS_Free();
WizardForm.Free;
end;
[/more]
Автор: ENERGES
Дата сообщения: 15.02.2012 18:31
R3Pa4eK
и тебе спасибо
Автор: sergey3695
Дата сообщения: 15.02.2012 18:44
....
Автор: ENERGES
Дата сообщения: 15.02.2012 18:45
....
Автор: Genri
Дата сообщения: 15.02.2012 22:24
IIaBeJl

Цитата:
задача - номер версии, который будет показываться в инсталляторе брать с файла, который будет лежать возле него.
-- [more]
Код: [no]
[Setup]
AppName=My Program
AppVerName=My Program {code:MyVersion}
DefaultDirName={pf}\My Program

[Code]
function MyVersion(Param: String): String;
begin
Result := GetIniString('Setup', 'Version', '1.0', ExpandConstant('{src}\MyProgram.ini'));
end;
[/no]
Автор: Kindly
Дата сообщения: 16.02.2012 04:27
IIaBeJl
procedure GetVersionInfo;
begin
if not GetVersionNumbersString(ResultStr +'\'+ iFile + '', Version) then
begin
Ver:='Not Available!'
end else
begin
Ver:=Version;
end;
end;

Подойдет только для PE с указанной версией в ресурсах
Автор: IIaBeJl
Дата сообщения: 16.02.2012 10:36

Цитата:
IIaBeJl
procedure GetVersionInfo;
begin
 if not GetVersionNumbersString(ResultStr +'\'+ iFile + '', Version) then
    begin
      Ver:='Not Available!'
    end else
    begin
      Ver:=Version;
    end;
end;
 
Подойдет только для PE с указанной версией в ресурсах

Это вы указали тоже, что и Genri, только версию извлекать не из ini, а из какого-то файла запуска?

Добавлено:
Genri, спасибо, все работает

Добавлено:
Судя по всему для директивы ExtraDiskSpaceRequired в секции Setup не получится из функции получить размер?

Только что попробовал:


Код: ...
ExtraDiskSpaceRequired={code:GetArchSize}
...
[Code]
function GetArchSize(Param: String): String;
begin
    Result := '5000';
end;
Автор: Genri
Дата сообщения: 16.02.2012 12:00
IIaBeJl -- Kindly дал пример извлечения версии из какого-нибудь файла, который содержит версию. Например, файлы которые ты инсталлируешь лежат рядом с инсталлятором. Один из файлов есть всегда. Он имеет свою версию (посмотреть в свойствах файла) и этот номер версии совпадает с номером версии, которую надо показать пользователю при обновлении. При соблюдении этих условий, версию можно получать из этого файла тогда этот способ является предпочтительным (пользователь будет видеть именно ту версию, который ставит инсталлятор, а не то что прописали в инишник). [more]
Код: [no]
[Setup]
AppName=My Program
AppVerName=My Program {code:MyVersion}
DefaultDirName={pf}\My Program

[Code]
function MyVersion(Param: String): String;
var
Version: string;
begin
if not GetVersionNumbersString(ExpandConstant('{sys}\calc.exe'), Version) then
begin
Result:= '1.0';
end else
begin
Result:= Version;
end;
end;
[/no]
Автор: IIaBeJl
Дата сообщения: 16.02.2012 16:31
Кто-то смог заставить адекватно работать перевод в InnoTools Downloader? Вытягивает мне какие-то названия функций вместо переводов...
Автор: SotM
Дата сообщения: 16.02.2012 18:33
IIaBeJl
Ты о каком переводе говоришь? Перевод кого, куда?
Автор: IIaBeJl
Дата сообщения: 16.02.2012 20:08
SotM, перевод языка интерфейса страницы загрузки файлов. Там какие-то проблемы с адресацией.
Автор: SotM
Дата сообщения: 16.02.2012 20:34
А зачем переводить то?!
Заходишь сюда и скачиваешь то, что нужно.
Автор: viktor9
Дата сообщения: 16.02.2012 21:01
Ребята нужна ваша помощь хочу совместить 2 скрипта
[more]
Код: // установка в директорию

function NextButtonClick(CurPage: Integer): Boolean;
var
sz:Integer;
s:string;
h:Longint;
begin
Result:=True;
If CurPage=1
then
begin
h:=FindWindowByClassName('My-Program-WINDOW');
If h<>0 then
SendMessage(h, 16, 0, 0); //Вот это и есть закрытие программы
end
else
If CurPage=6 then
//Проверка присутствия определенных файлов в папке с установленной программой на странице выбора папки назначения
begin
If (FileSearch('Steam.dll', ExpandConstant('{app}'))='') //ищем файл [Main.exe] в папке {app}.
then
begin
s:='Извините, вы неправильно ' #13 'указали путь к папке с установленной игрой. Counter-Strike' #13#13 'Пожалуйста, выберите правильный путь к файлу hl.exe или cstrike.exe, ' #13 ' для установки обновления.';
MsgBox(s, mbError, mb_Ok);
Result:= False
end;
end;
end;
Автор: IIaBeJl
Дата сообщения: 16.02.2012 21:33
SotM, мой файл инсталляции должен быть на 4-ёх языках (включая английский и русский). В файл инсталляции входит плагин InnoTools Downloader, который скачивает архив с интернета. Плагин создаёт отдельную страницу в инсталляторе, на которой он показывает прогресс закачки. На этой странице находится несколько текстовых полей, описывающих процесс загрузки файла. Они должны быть переведены для каждого языка. Так как плагин писался под ANSI версию Inno Setup, то мало того, что пришлось немного отредактировать сам пример, идущий в комплекте с InnoTools Dpwnloader, так он еще и не правильно переводы дергает из своих файлов переводов.

Теперь понятно?
Автор: viktor9
Дата сообщения: 16.02.2012 21:40
IIaBeJl
посмотри мой примет у меня вроде все языки понимает
[more]
Код: #include 'it_download.iss'
#define public version "1.6.4.0"
#define siteUrl "http://mysite.ru"
#define updateUrl "http://mysite.ru"
#define supportUrl "http://mysite.ru/forum/"
#define brend "mysite.ru"
#define updateSiteURL "http://mysite.ru/files/"
#define updateFileName "version_myAC.txt"

[Setup]
AppName=myAC.Client
VersionInfoVersion={#version}
AppVersion={#version}
AppVerName=myAC.Client {#version}
AppPublisher=RIP
AppPublisherURL={#siteUrl}
AppSupportURL={#supportUrl}
AppUpdatesURL={#updateUrl}
AppCopyright=Copyright (C) http://myac.msk.ru
DefaultDirName={pf32}\myAC_{#brend}
DefaultGroupName=myAC.Client {#brend}
OutputDir=..\
OutputBaseFilename=myAC.Client_{#brend}
Compression=lzma2/Max
SolidCompression=true
DirExistsWarning=no
ShowTasksTreeLines=false
AppID={{082E6F6E-EB2E-4E3C-A02F-A38B834F06CE}}

[Languages]
Name: ru; MessagesFile: compiler:Languages\Russian.isl
Name: en; MessagesFile: compiler:Default.isl
;Name: fr; MessagesFile: compiler:Languages\French.isl
;Name: nl; MessagesFile: compiler:Languages\Dutch.isl
;Name: ptbr; MessagesFile: compiler:Languages\BrazilianPortuguese.isl

[Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: checkablealone
Name: quicklaunchicon; Description: {cm:CreateQuickLaunchIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked
;Name: chek_x64; Description: {cm:W_testMode}; GroupDescription: {cm:TestModeCaption}; Flags: checkablealone restart exclusive; Check: "not TestModeCheck and IsWin64";

[Files]
Source: D:\Program Files\cs_proekt\Plusnet_AntiCheat\config.ini; DestDir: {app}; Flags: 32bit IgnoreVersion
Source: D:\Program Files\cs_proekt\Plusnet_AntiCheat\myAC.ex; DestDir: {app}; Flags: 32bit IgnoreVersion
Source: D:\Program Files\cs_proekt\Plusnet_AntiCheat\myAC.exe; DestDir: {app}; Flags: 32bit IgnoreVersion
;Source: ..\additional\onTestMode.lnk; DestDir: {app}; Flags: 64bit ignoreversion; Check: IsWin64;
;Source: ..\additional\offTestMode.lnk; DestDir: {app}; Flags: 64bit ignoreversion; Check: IsWin64;

Source: languages\*.ini; Flags: dontcopy

[INI]
Filename: {app}\myac.url; Section: InternetShortcut; Key: URL; String: {#supportUrl}

[Icons]
Name: {group}\{cm:ProgramOnTheWeb,myAC.Client}; Filename: {app}\myac.url
Name: {group}\{cm:UninstallProgram,myAC.Client}; Filename: {uninstallexe}
Name: {group}\myAC.Client {#brend}; Filename: {app}\myAC.exe; WorkingDir: {app}; Tasks:
Name: {userdesktop}\myAC.Client {#brend}; Filename: {app}\myAC.exe; WorkingDir: {app}; Tasks: desktopicon
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\myAC.Client {#brend}; Filename: {app}\myAC.exe; WorkingDir: {app}; Tasks: quicklaunchicon
;Name: {group}\{cm:W_testMode}; Filename: {app}\onTestMode.lnk;Check: IsWin64;
;Name: {group}\{cm:W_testModeOff}; Filename: {app}\offTestMode.lnk;Check: IsWin64;

[Run]
Filename: {app}\myAC.exe; Parameters: ; WorkingDir: {app}; Description: {cm:LaunchProgram,myAC.Client}; Flags: nowait postinstall skipifsilent
;MinVersion: ,6.0.6000; Filename: bcdedit.exe; Parameters: -set TESTSIGNING ON; Flags: NoWait RunHidden; Tasks: chek_x64;

;[UninstallRun]
;MinVersion: ,6.0.6000; Filename: bcdedit.exe; Parameters: -set TESTSIGNING OFF; Flags: NoWait RunHidden; Check: IsWin64;

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


;[CustomMessages]
;Russian.W_testMode=Включает тестовый режим для x64 версии Windows
;English.W_testMode=Enable test mode for x64 versions of Windows
;Russian.W_testModeOff=Отключить тестовый режим для x64 версии Windows
;English.W_testModeOff=Disable test mode for x64 versions of Windows
;Russian.TestModeCaption=Тестовый режим
;English.TestModeCaption=Test Mode


[Code]
{ This demo performs two downloads, one without ITD's GUI, and one with. It checks a website to
find out what the most recent version of the installer is, and offers to download the new installer
for the user.
}

procedure ExitProcess(exitCode:integer);
external 'ExitProcess@kernel32.dll stdcall';

var progress:TOutputProgressWizardPage;

var
NewInstallerPath:string;

procedure DownloadFinished(downloadPage:TWizardPage);
var ErrorCode:integer;
(* text:string; *)
begin
(*
     Tell the user about the new installer. The message is pretty ugly if
     NewInstallerPath is left at the default (The {tmp} directory)

     text:=ITD_GetString(ITDS_Update_WillLaunchWithPath);

     StringChangeEx(text, '%1', NewInstallerPath, true);

     MsgBox(text, mbInformation, MB_OK);
*)

MsgBox(ITD_GetString(ITDS_Update_WillLaunch), mbInformation, MB_OK);

if ShellExec('open', NewInstallerPath, '/updated',
ExtractFilePath(NewInstallerPath), SW_SHOW, ewNoWait, ErrorCode) then
ExitProcess(1);
end;

{ Compare the version string 'this' against the version string 'that'. A version
string looks like: 1.3.2.100. Or possibly truncated: 1.3.

Returns a positive number if this>that, 0 if this=that and a negative number
if this<that.
}
function CompareVersions(this, that:string):integer;
var thisField, thatField:integer;
begin
while (length(this)>0) or (length(that)>0) do begin
if (pos('.',this)>0) then begin
//Read the first field from the string
thisField:=StrToIntDef(Copy(this, 1, pos('.',this)-1),0);
//Remove the first field from the string
this:=Copy(this, pos('.',this)+1, length(this));
end else begin
thisField:=StrToIntDef(this, 0);
this:='';
end;

if (pos('.',that)>0) then begin
//Read the first field from the string
thatField:=StrToIntDef(Copy(that, 1, pos('.',that)-1),0);
//Remove the first field from the string
that:=Copy(that, pos('.',that)+1, length(that));
end else begin
thatField:=StrToIntDef(that, 0);
that:='';
end;

if thisField>thatField then begin
result:=1;
exit;
end else if thisField<thatField then begin
result:=-1;
exit;
end;
end;

result:=0;
end;

procedure LoadITDLang;
var lang:string;
begin
lang:=ExpandConstant('{language}');

try
ExtractTemporaryFile('itd_'+lang+'.ini');

ITD_LoadStrings(expandconstant('{tmp}\itd_'+lang+'.ini'));
except
{We get here if the selected language wasn't included in the
set of ITD translation files. In this case, just use ITD's
built in translation file (English), by not loading anything.

Note that the exception will still appear while debugging -
you can turn this off in Inno Setup Compiler options
("Pause on exceptions"), or just ignore it. It doesn't appear
at runtime.}
end;
end;

procedure InitializeWizard();
var
downloadPage:TWizardpage;
begin
itd_init;
LoadITDLang;
//Where the new installer should be saved to, can be anywhere.
NewInstallerPath:=ExpandConstant('{tmp}\New_myAC.exe');

{Create our own progress page for the initial download of a small
textfile from the server which says what the latest version is}
progress:=CreateOutputProgressPage(ITD_GetString(ITDS_Update_Caption),
ITD_GetString(ITDS_Update_Description));

//Create the ITD GUI so that we have it if we decide to download a new intaller version
downloadPage:=itd_downloadafter(wpWelcome);

{If the download succeeds, we will need to launch the new installer. The
callback is called if the download is successful.}
itd_afterSuccess:=@downloadfinished;

{If the download of the new installer fails, we still want to give the
user the option of continuing with the original installation}
itd_setoption('UI_AllowContinue','1');
end;

function NextButtonClick(curPageID:integer):boolean;
var
list, line:TStringList;
newavail:boolean;
i:integer;
ourVersion:string;
checkedSuccessfully:boolean;
text:string;
begin
result:=true;
if curPageID=wpWelcome then begin

//Are we being called by an updating setup? If so, don't ask to check for updates again!
for i:=1 to ParamCount do begin
if uppercase(ParamStr(i))='/UPDATED' then begin
exit;
end;
end;

//Offer to check for a new version for the user..
// if MsgBox(ITD_GetString(ITDS_Update_WantToCheck), mbConfirmation, MB_YESNO) = IDYES then
begin
wizardform.show;
progress.Show;
progress.SetText(ITD_GetString(ITDS_Update_Checking),'');
progress.SetProgress(2,10);
try
newavail:=false;

checkedSuccessfully:=false;
GetVersionNumbersString(expandconstant('{srcexe}'), ourVersion);

if itd_downloadfile('{#updateSiteURL}{#updateFileName}',expandconstant('{tmp}\{#updateFileName}'))=ITDERR_SUCCESS then begin
{ Now read the version from that file and see if it is newer.
The file has a really simple format:

2.0,"http://www.sherlocksoftware.org/innotools/example3%202.0.exe"

The installer version, a comma, and the URL where the new version can be downloaded.
}
list:=TStringList.create;
try
list.loadfromfile(expandconstant('{tmp}\{#updateFileName}'));

if list.count>0 then begin
line:=TStringList.create;
try
line.commatext:=list[0]; //Break down the line into its components

if line.count>=2 then begin
checkedSuccessfully:=true;
if CompareVersions(trim(line[0]), trim(ourVersion))>0 then begin
//Version is newer
text:=ITD_GetString(ITDS_Update_NewAvailable);

StringChangeEx(text, '%1', ourVersion, true); //"Current version" part of the string
StringChangeEx(text, '%2', line[0], true); //"New version" part of the string

if MsgBox(text, mbConfirmation, MB_YESNO)=IDYES then begin
itd_addFile(trim(line[1]), NewInstallerPath);
end;
end else begin
// MsgBox(ITD_GetString(ITDS_Update_NoNewAvailable), mbInformation, MB_OK);
end;
end;
finally
line.free;
end;
end;
finally
list.free;
end;
end;

if not checkedSuccessfully then begin
text:=ITD_GetString(ITDS_Update_Failed);
         StringChangeEx(text, '%1', ourVersion, true);
// MsgBox(text, mbInformation, MB_OK);
end;
finally
progress.Hide;
end;
end;
end;
end;
Автор: Kindly
Дата сообщения: 17.02.2012 04:33
viktor9, недопустимо использовать две функции с одинаковыми именами! Комбинируй и сливай.
Автор: StranaOz
Дата сообщения: 17.02.2012 08:49
подскажите плз, как можно запустить компиляцию инсталятора из консоли?
Автор: viktor9
Дата сообщения: 17.02.2012 09:26
Kindly
спасибо уже сам разобрался прога InnoSetup Script Joiner помогла
Автор: Genri
Дата сообщения: 17.02.2012 10:49
StranaOz

Цитата:
как можно запустить компиляцию инсталятора из консоли?
-- Inno Setup Help - Other Information - Command Line Compiler Execution
Автор: viktor9
Дата сообщения: 17.02.2012 14:02
Ребята есть такой скрипт InnoTools Downloader в нем есть примеры и в ондноп примере есть как подключить языковый файл
Я делаю так
[more]
Код: #define MyAppName "My Program"
#define MyAppVerName "My Program 1.0"
#define MyAppPublisher "My Company, Inc."
#define MyAppURL "http://www.mycompany.com"

[Setup]
AppName={#MyAppName}
AppVerName={#MyAppVerName}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputBaseFilename=example3 2.0
Compression=lzma
SolidCompression=true
CreateAppDir=true
ShowLanguageDialog=yes

; We compare the setup version information here against
; the one on the server to check for a newer version.
VersionInfoVersion=2.0
VersionInfoTextVersion=2.0

[Languages]
Name: ru; MessagesFile: compiler:Languages\Russian.isl

#define ITDRoot ReadReg(HKEY_LOCAL_MACHINE,'Software\Sherlock Software\InnoTools\Downloader','InstallPath','')

#include ITDRoot+'\it_download.iss'
[Files]
Source: {#ITDRoot}\languages\*.ini; Flags: dontcopy


Код:
{ This demo performs two downloads, one without ITD's GUI, and one with. It checks a website to
find out what the most recent version of the installer is, and offers to download the new installer
for the user.
}

procedure ExitProcess(exitCode:integer);
external 'ExitProcess@kernel32.dll stdcall';

var progress:TOutputProgressWizardPage;

var
NewInstallerPath:string;

procedure DownloadFinished(downloadPage:TWizardPage);
var ErrorCode:integer;
(* text:string; *)
begin
(*
     Tell the user about the new installer. The message is pretty ugly if
     NewInstallerPath is left at the default (The {tmp} directory)

     text:=ITD_GetString(ITDS_Update_WillLaunchWithPath);

     StringChangeEx(text, '%1', NewInstallerPath, true);

     MsgBox(text, mbInformation, MB_OK);
*)

MsgBox(ITD_GetString(ITDS_Update_WillLaunch), mbInformation, MB_OK);

if ShellExec('open', NewInstallerPath, '/updated',
ExtractFilePath(NewInstallerPath), SW_SHOW, ewNoWait, ErrorCode) then
ExitProcess(1);
end;

{ Compare the version string 'this' against the version string 'that'. A version
string looks like: 1.3.2.100. Or possibly truncated: 1.3.

Returns a positive number if this>that, 0 if this=that and a negative number
if this<that.
}
function CompareVersions(this, that:string):integer;
var thisField, thatField:integer;
begin
while (length(this)>0) or (length(that)>0) do begin
if (pos('.',this)>0) then begin
//Read the first field from the string
thisField:=StrToIntDef(Copy(this, 1, pos('.',this)-1),0);
//Remove the first field from the string
this:=Copy(this, pos('.',this)+1, length(this));
end else begin
thisField:=StrToIntDef(this, 0);
this:='';
end;

if (pos('.',that)>0) then begin
//Read the first field from the string
thatField:=StrToIntDef(Copy(that, 1, pos('.',that)-1),0);
//Remove the first field from the string
that:=Copy(that, pos('.',that)+1, length(that));
end else begin
thatField:=StrToIntDef(that, 0);
that:='';
end;

if thisField>thatField then begin
result:=1;
exit;
end else if thisField<thatField then begin
result:=-1;
exit;
end;
end;

result:=0;
end;

procedure LoadITDLang;
var lang:string;
begin
lang:=ExpandConstant('{language}');

try
ExtractTemporaryFile('itd_'+lang+'.ini');

ITD_LoadStrings(expandconstant('{tmp}\itd_'+lang+'.ini'));
except
{We get here if the selected language wasn't included in the
set of ITD translation files. In this case, just use ITD's
built in translation file (English), by not loading anything.

Note that the exception will still appear while debugging -
you can turn this off in Inno Setup Compiler options
("Pause on exceptions"), or just ignore it. It doesn't appear
at runtime.}
end;
end;

procedure InitializeWizard();
var
downloadPage:TWizardpage;
begin
itd_init;

LoadITDLang;

//Where the new installer should be saved to, can be anywhere.
NewInstallerPath:=ExpandConstant('{tmp}\NewInstaller.exe');

{Create our own progress page for the initial download of a small
textfile from the server which says what the latest version is}
progress:=CreateOutputProgressPage(ITD_GetString(ITDS_Update_Caption),
ITD_GetString(ITDS_Update_Description));

//Create the ITD GUI so that we have it if we decide to download a new intaller version
downloadPage:=itd_downloadafter(wpWelcome);

{If the download succeeds, we will need to launch the new installer. The
callback is called if the download is successful.}
itd_afterSuccess:=@downloadfinished;

{If the download of the new installer fails, we still want to give the
user the option of continuing with the original installation}
itd_setoption('UI_AllowContinue','1');
end;

function NextButtonClick(curPageID:integer):boolean;
var
list, line:TStringList;
newavail:boolean;
i:integer;
ourVersion:string;
checkedSuccessfully:boolean;
text:string;
begin
result:=true;
if curPageID=wpWelcome then begin

//Are we being called by an updating setup? If so, don't ask to check for updates again!
for i:=1 to ParamCount do begin
if uppercase(ParamStr(i))='/UPDATED' then begin
exit;
end;
end;

//Offer to check for a new version for the user..
if MsgBox(ITD_GetString(ITDS_Update_WantToCheck), mbConfirmation, MB_YESNO) = IDYES then
begin
wizardform.show;
progress.Show;
progress.SetText(ITD_GetString(ITDS_Update_Checking),'');
progress.SetProgress(2,10);
try
newavail:=false;

checkedSuccessfully:=false;
GetVersionNumbersString(expandconstant('{srcexe}'), ourVersion);

if itd_downloadfile('http://www.sherlocksoftware.org/innotools/latestver.txt',expandconstant('{tmp}\latestver.txt'))=ITDERR_SUCCESS then begin
{ Now read the version from that file and see if it is newer.
The file has a really simple format:

2.0,"http://www.sherlocksoftware.org/innotools/example3%202.0.exe"

The installer version, a comma, and the URL where the new version can be downloaded.
}
list:=TStringList.create;
try
list.loadfromfile(expandconstant('{tmp}\latestver.txt'));

if list.count>0 then begin
line:=TStringList.create;
try
line.commatext:=list[0]; //Break down the line into its components

if line.count>=2 then begin
checkedSuccessfully:=true;
if CompareVersions(trim(line[0]), trim(ourVersion))>0 then begin
//Version is newer
text:=ITD_GetString(ITDS_Update_NewAvailable);

StringChangeEx(text, '%1', ourVersion, true); //"Current version" part of the string
StringChangeEx(text, '%2', line[0], true); //"New version" part of the string

if MsgBox(text, mbConfirmation, MB_YESNO)=IDYES then begin
itd_addFile(trim(line[1]), NewInstallerPath);
end;
end else begin
MsgBox(ITD_GetString(ITDS_Update_NoNewAvailable), mbInformation, MB_OK);
end;
end;
finally
line.free;
end;
end;
finally
list.free;
end;
end;

if not checkedSuccessfully then begin
text:=ITD_GetString(ITDS_Update_Failed);
         StringChangeEx(text, '%1', ourVersion, true);
MsgBox(text, mbInformation, MB_OK);
end;
finally
progress.Hide;
end;
end;
end;
end;
Автор: Igimon
Дата сообщения: 18.02.2012 12:43
У меня такой вопрос, требуется чтобы инсталлятор Inno Setup
при выборе определенного компонента внес изменения
в INI файл в папке {app} вписав строку с константой {src}


Код:
Пример...

[INI]
Filename: {app}\dir.ini; Section:; Key:; String: {src}\Pictures;
Автор: Tapas77789
Дата сообщения: 18.02.2012 13:07
Igimon
savestringtofile
savestringstofile
Автор: R3Pa4eK
Дата сообщения: 18.02.2012 13:13
Igimon
[INI]
Filename: {app}\dir.ini; Section: ""; Key: ""; String: {src}\Pictures;

А еще есть функция SetIniString...
Автор: Igimon
Дата сообщения: 18.02.2012 13:36
R3Pa4eK
А пример данной функции если не сложно привести можно?
Автор: R3Pa4eK
Дата сообщения: 18.02.2012 13:42
Igimon
[more=Держи...]
[Setup]
AppName=MyApp
AppVerName=MyApp
DefaultDirName={pf}\MyApp

[Code]
procedure InitializeWizard;
begin
SetIniString('Game', 'Language', 'English', 'file.ini');
end;
[/more]
Автор: Genri
Дата сообщения: 18.02.2012 19:45
Igimon

Цитата:
указанный INI файл в принципе не содержит не секций не ключей.
-- значит это не ини-файл. Формат ини-файла предусматривает определенную структуру содержимого (секции, ключи). Ини-файл или обычный текстовый файл - определяется структурой, а не расширением. В твоем случае, это обычный текстовый файл. Используй, функции, которые упоминал Tapas77789.
Автор: xanloz
Дата сообщения: 19.02.2012 11:01
Доброго всем времени суток,
У меня проблема: при подключении к скрипту ISDone вылазит ошибка
Runtime Error (at 112:541)
Could not call proc.
Если кто-то может помочь вот скрипт со всем нужным http://rghost.ru/36594417, заранее спасибо.

Страницы: 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177

Предыдущая тема: поиск


Форум Ru-Board.club — поднят 15-09-2016 числа. Цель - сохранить наследие старого Ru-Board, истории становления российского интернета. Сделано для людей.