PDA

Показать полную графическую версию : [архив] Inno Setup .:[все вопросы]:.


Страниц : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 [55] 56 57 58 59 60 61 62 63 64 65 66 67

Raf-9600
05-07-2009, 17:54
Интересует ещё один важный вопрос: можно ли как-то заставить прогу, при запуске (в данный момент, она через [Run]) работать в "невидимом" режиме? Испробывал и RunHidden и RunMinimized, ничего не подействовало. Может через это можно реализовать? В данный момент эта строчка выглядит так:
[CODE]Filename: "{app}\WinMPQ-SU.exe"; Flags: runhidden; Parameters: s Sound.txt; StatusMsg: "Встраивание озвучки юнитов..."; Components: inMPQ; Flags: skipifdoesntexist
И она должна работать только после того, как отработает эта:
Filename: "{app}\del Ogg [SoundUnit].bat"; Flags: runhidden; StatusMsg: "Удаление лишних файлов..."; Components: SoundUnit;

p3rf3ct1c
06-07-2009, 02:22
Здравствуйте! Подскажите как добавить чекбокс на странице завершения, вниз около кнопки завершить? И чтобы когда была отмечена галочка, началась установка какой либо программы.
http://pic.ipicture.ru/uploads/090706/nBBsGy279W.png

Serega
06-07-2009, 20:59
как добавить чекбокс на странице завершения »
[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

[Code]
var
RunProg: TCheckBox;

procedure CheckBoxChecked;
begin
if RunProg.Checked then
MsgBox('CheckBox отмечен...', mbInformation, MB_OK);
end;

procedure GreatCheckBox;
begin
RunProg:= TCheckBox.Create(WizardForm);
with RunProg do
begin
Parent := WizardForm;
Caption := 'Запустить программу?';
SetBounds(140,330,150,15);
Cursor:= crHand;
Checked:= True;
end;
end;

procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpFinished then GreatCheckBox;
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssDone then CheckBoxChecked;
end;


можно ли как-то заставить прогу, при запуске (в данный момент, она через [Run]) работать в "невидимом" режиме? »
Всё зависит от программы.
Если она небольшая (просто у меня интернет платный), то дайте ссылку, можно глянуть...

Raf-9600
06-07-2009, 22:06
Serega, В архиве - 152 КБ (http://shareua.com/get_file/b7b884/3098591). Но требует наличия Visual Basic 4 (http://shareua.com/get_file/08b3f3/3098601) (832 КБ)

p3rf3ct1c
06-07-2009, 22:49
Serega,
Спасибо, вот только я не могу догадаться что надо добавить там где я отметил жирным и подчеркнул
FileName: {src}\Redistributables\gfwlivesetup.exe; WorkingDir: {src}\Redistributables; Check:

чтобы при отмеченном чекбоксе началась установка программы.

Можете еще помочь вставить этот код в мой, а то я все вставил и при при компиляции, запуске, установке ошибок нет, но в конце чекбокс всеравно не отображается.
[Setup]
SourceDir=.
OutputDir=Setup
AppName=FUEL
AppVerName=FUEL
AppVersion=FUEL
DefaultDirName={pf}\FUEL
DefaultGroupName=FUEL
AllowNoIcons=yes
OutputBaseFilename=setup
UninstallFilesDir={app}\Uninstall
WizardImageFile=C:\Users\p3rf3ct1c\Desktop\big.bmp
WizardSmallImageFile=C:\Users\p3rf3ct1c\Desktop\small.bmp
SetupIconFile=C:\Users\p3rf3ct1c\Desktop\icon.ico
WindowVisible=no
WindowShowCaption=no
WindowResizable=no
Compression=lzma/ultra
DiskSpanning=yes
DiskSliceSize=692060160
SlicesPerDisk=1
DisableProgramGroupPage=true
DisableReadyPage=true

[Messages]
WelcomeLabel1=
WelcomeLabel2=
ClickNext=
WizardSelectDir=
SelectDirDesc=
WizardInstalling=
InstallingLabel=
FinishedHeadingLabel=
SelectDirBrowseLabel=Íàæìèòå «Óñòàíîâèòü», ÷òîáû íà÷àòü óñòàíîâêó. Åñëè Âû õîòèòå âûáðàòü äðóãóþ ïàïêó, íàæìèòå «Îáçîð».


[CustomMessages]
rus.ArcCancel=Îòìåíèòü ðàñïàêîâêó
rus.ArcBreak=Óñòàíîâêà ïðåðâàíà!
rus.ArcInfo=Ðàñïàêîâàíî %1 Ìá èç %2 Ìá (%3%%). Àðõèâ: %4 èç %5.
rus.ArcTitle=Ðàñïàêîâêà àðõèâîâ FreeArc
rus.ArcError=Ðàñïàêîâùèê FreeArc âåðíóë êîä îøèáêè: %1
rus.ArcFail=Ðàñïàêîâêà íå çàâåðøåíà!
rus.AllProgress=Îáùèé ïðîãðåññ ðàñïàêîâêè: %1%%
rus.ArcBroken=Âîçìîæíî, àðõèâ %1 ïîâðåæä¸í%nèëè íåäîñòàòî÷íî ìåñòà íà äèñêå íàçíà÷åíèÿ.
rus.Extracting=Ðàñïàêîâûâàåòñÿ: %1
rus.remains=%1%%, æäè %2
rus.LongTime=âå÷íî
rus.ending=çàâåðøåíèå


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

[Files]
Source: C:\Program Files\Codejock Software\ISSkin\ISSkin.dll; DestDir: {tmp}; Flags: dontcopy
Source: C:\Program Files\Codejock Software\ISSkin\Styles\GuiStyle.msstyles; DestDir: {tmp}; Flags: dontcopy

Source: unarc.dll; DestDir: {tmp}; Flags: dontcopy deleteafterinstall
Source: InnoCallback.dll; DestDir: {tmp}; Flags: dontcopy
Source: "C:\Users\p3rf3ct1c\Desktop\unp\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs sortfilesbyextension

[Icons]
Name: {group}\Óäàëèòü èãðó; Filename: {uninstallexe}
Name: {group}\FUEL; Filename: {app}\GameSetup.exe; WorkingDir: {app};
Name: {commondesktop}\FUEL; Filename: {app}\GameSetup.exe; WorkingDir: {app}; Check: MakeDesktopIcon;



[Registry]
Root: HKLM; Subkey: "SOFTWARE\FUEL"; ValueType: string; ValueName: "Uninstall"; ValueData: "\""{pf}\InstallShield Installation Information\{{F51FF206-2273-4B3E-A90A-4752AE288C12}\setup.exe\"""
Root: HKLM; Subkey: "SOFTWARE\FUEL"; ValueType: string; ValueName: "GamePath"; ValueData: "{app}"
Root: HKLM; Subkey: "SOFTWARE\FUEL"; ValueType: string; ValueName: "UserLanguageID"; ValueData: "1033"
Root: HKLM; Subkey: "SOFTWARE\FUEL"; ValueType: string; ValueName: "InstanceGUID"; ValueData: "{{7D50D94D-1DCA-4951-A73A-3B25B1425345}"


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

[code]
const
Archives = '{src}\*.arc'; // óêàæèòå ðàñïîëîæåíèå àðõèâîâ FreeArc; äëÿ âíåøíèõ ôàéëîâ ñòðîêó â [Files] äîáàâëÿòü íåîáÿçàòåëüíî

PM_REMOVE = 1;
CP_ACP = 0; CP_UTF8 = 65001;

HALIGN_CENTER = 0;
HALIGN_LEFT = 1;
HALIGN_RIGHT = 2;

VALIGN_CENTER = 0;
VALIGN_TOP = 1;
VALIGN_BOTTOM = 2;

FIT_NONE = 0;
FIT_WIDTH = 1;
FIT_HEIGHT = 2;
FIT_BOTH = 3;

CLR_INVALID = $FFFFFFFF;

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('GuiStyle.msstyles');
LoadSkin(ExpandConstant('{tmp}\GuiStyle.msstyles'), '');
Result := True;
end;
procedure DeinitializeSetup();
begin
ShowWindow(StrToInt(ExpandConstant('{wizardhwnd}')), 0);
UnloadSkin();

end;
type
#ifdef UNICODE ; åñëè ó âàñ îøèáêà íà ýòîé ñòðîêå, òî óñòàíîâèòå ïðåïðîöåññîð èëè èñïðàâüòå ñêðèïò äëÿ âàøåé âåðñèè Inno Setup
#define A "W"
#else
#define A "A" ; òî÷êà âõîäà â SetWindowText, {#A} ìåíÿåòñÿ íà A èëè W â çàâèñèìîñòè îò âåðñèè
PAnsiChar = PChar; // Required for Inno Setup 5.3.0 and higher. (òðåáóåòñÿ äëÿ Inno Setup âåðñèè 5.3.0 è íèæå)
#endif
#if Ver < 84018176
AnsiString = String; // There is no need for this line in Inno Setup 5.2.4 and below (äëÿ Inno Setup âåðñèé 5.2.4 è âûøå ýòà ñòðîêà íå íóæíà)
#endif

TMyMsg = record
hwnd: HWND;
message: UINT;
wParam: Longint;
lParam: Longint;
time: DWORD;
pt: TPoint;
end;

TFreeArcCallback = function (what: PAnsiChar; int1, int2: Integer; str: PAnsiChar): Integer;
TArc = record Path: string; Size: Extended; end;

var
FreeMB, TotalMB: Cardinal;
DesktopIcon,Dop: TCheckBox;
ProgressBar: TNewProgressBar;
ExtractFile: TNewStaticText;
PageNameLabel, PageDescriptionLabel,NeedSpaceLabel,FreeSpaceLabel,lblExtractFileName: TLabel;
btnCancelUnpacking: TButton;
NeedSize,CancelCode, n, UnPackError, StartInstall: Integer;
Arcs: array of TArc;
msgError: string;
m: Extended;

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 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 InstallDop:Boolean;
begin
Result:=Dop.Checked;
end;


Function MultiByteToWideChar(CodePage: UINT; dwFlags: DWORD; lpMultiByteStr: string; cbMultiByte: integer; lpWideCharStr: string; cchWideChar: integer): longint; external 'MultiByteToWideChar@kernel32.dll stdcall';
Function WideCharToMultiByte(CodePage: UINT; dwFlags: DWORD; lpWideCharStr: string; cchWideChar: integer; lpMultiByteStr: string; cbMultiByte: integer; lpDefaultChar: integer; lpUsedDefaultChar: integer): longint; external 'WideCharToMultiByte@kernel32.dll stdcall';

function PeekMessage(var lpMsg: TMyMsg; hWnd: HWND; wMsgFilterMin, wMsgFilterMax, wRemoveMsg: UINT): BOOL; external 'PeekMessageA@user32.dll stdcall';
function TranslateMessage(const lpMsg: TMyMsg): BOOL; external 'TranslateMessage@user32.dll stdcall';
function DispatchMessage(const lpMsg: TMyMsg): Longint; external 'DispatchMessageA@user32.dll stdcall';

Function OemToChar(lpszSrc, lpszDst: AnsiString): longint; external 'OemToCharA@user32.dll stdcall';
function GetWindowLong(hWnd, nIndex: Integer): Longint; external 'GetWindowLongA@user32 stdcall delayload';
function SetWindowText(hWnd: Longint; lpString: String): Longint; external 'SetWindowText{#A}@user32 stdcall delayload';

function GetTickCount: DWord; external 'GetTickCount@kernel32';
function WrapFreeArcCallback (callback: TFreeArcCallback; paramcount: integer):longword; external 'wrapcallback@files:innocallback.dll stdcall';
function FreeArcExtract (callback: longword; cmd1,cmd2,cmd3,cmd4,cmd5,cmd6,cmd7,cmd8,cmd9,cmd10: PAnsiChar): integer; external 'FreeArcExtract@files:unarc.dll cdecl';

procedure AppProcessMessage;
var
Msg: TMyMsg;
begin
while PeekMessage(Msg, WizardForm.Handle, 0, 0, PM_REMOVE) do begin
TranslateMessage(Msg);
DispatchMessage(Msg);
end;
end;

Function NumToStr(Float: Extended): String; {Ïåðåâîä ÷èñëà â ñòðîêó ñ òî÷íîñòüþ 3 çíàêà (%.3n) ñ îêðóãëåíèåì äðîáíîé ÷àñòè, åñëè îíà åñòü}
Begin
Result:= Format('%.3n', [Float]); StringChange(Result, ',', '.'); while ((Result[Length(Result)] = '0') or (Result[Length(Result)] = '.')) and (Length(Result) > 1) do SetLength(Result, Length(Result)-1);
End;

function cm(Message: String): String; Begin Result:= ExpandConstant('{cm:'+ Message +'}') End;

Function Size64(Hi, Lo: Integer): Extended;
Begin
Result:= Lo; if Lo< 0 then Result:= Result + $7FFFFFFF + $7FFFFFFF + 2; for Hi:= Hi-1 Downto 0 do Result:= Result + $7FFFFFFF + $7FFFFFFF + 2;
End;

// OnClick event function for btnCancel
procedure btnCancelUnpackingOnClick(Sender: TObject);
begin
if MsgBox( SetupMessage( msgExitSetupMessage ), mbInformation, MB_YESNO ) = IDYES then
CancelCode:= -127;
end;

// Scans the specified folders for archives and add them to list
function FindArcs(dir: string): Extended;
var
FSR: TFindRec;
Begin
if FindFirst(ExpandConstant(dir), FSR) then
try
repeat
// Skip everything but the folders
if FSR.Attributes and FILE_ATTRIBUTE_DIRECTORY > 0 then CONTINUE;
n:= GetArrayLength(Arcs);
// Expand the folder list
SetArrayLength(Arcs, n +1);
Arcs[n].Path:= ExtractFilePath(ExpandConstant(Archives)) + FSR.Name;
Arcs[n].Size:= Size64(FSR.SizeHigh, FSR.SizeLow);
Result:= Result + Arcs[n].Size;
until not FindNext(FSR);
finally
FindClose(FSR);
end;
End;

// Converts OEM encoded string into ANSI
// Ïðåîáðàçóåò OEM ñòðîêó â ANSI êîäèðîâêó
function OemToAnsiStr( strSource: AnsiString): AnsiString;
var
nRet : longint;
begin
SetLength( Result, Length( strSource ) );
nRet:= OemToChar( strSource, Result );
end;

// Converts ANSI encoded string into UTF-8
// Ïðåîáðàçóåò ñòðîêó èç ANSI â UTF-8 êîäèðîâêó
function AnsiToUtf8( strSource: string ): string;
var
nRet : integer;
WideCharBuf: string;
MultiByteBuf: string;
begin
strSource:= strSource + chr(0);
SetLength( WideCharBuf, Length( strSource ) * 2 );
SetLength( MultiByteBuf, Length( strSource ) * 2 );

nRet:= MultiByteToWideChar( CP_ACP, 0, strSource, -1, WideCharBuf, Length(WideCharBuf) );
nRet:= WideCharToMultiByte( CP_UTF8, 0, WideCharBuf, -1, MultiByteBuf, Length(MultiByteBuf), 0, 0);

Result:= MultiByteBuf;
end;

// Sets the TaskBar title
Procedure SetTaskBarTitle(Title: String); var h: Integer;
Begin
h:= GetWindowLong(MainForm.Handle, -8); if h <> 0 then SetWindowText(h, Title);
End;

// Converts milliseconds to standart time
Function TicksToTime(Ticks: DWord; detail: Boolean): String; Begin {ìèëèñåêóíäû â ñòàíäàðòíîå âðåìÿ}
if detail or (Ticks/3600 >= 1000) {hour} then if Ticks/3600000 > 23 then Result:= cm('LongTime') else Result:= PADZ(IntToStr(Ticks/3600000), 2) +':'+ PADZ(IntToStr((Ticks/1000 - Ticks/1000/3600*3600)/60), 2) +':'+ PADZ(IntToStr(Ticks/1000 - Ticks/1000/60*60), 2) else if Ticks/60 < 1000 {min} then Result:= IntToStr(Ticks/1000) +'.'+ NumToStr(trunc((Ticks/1000 - trunc(Ticks/1000))*10)) +'s' else Result:= IntToStr(Ticks/60000) +'m '+ PADZ(IntToStr(Ticks/1000 - Ticks/1000/60*60), 2) +'s';
End;

// The main callback function for unpacking FreeArc archives
function FreeArcCallback (what: PAnsiChar; Mb, sizeArc: Integer; str: PAnsiChar): Integer;
var
percents, Elapsed: Integer;
begin
if string(what)='filename' then

else
if (string(what)='progress') and (sizeArc>0) then
// Update progress bar with additional info
with WizardForm.ProgressGauge do
begin
// Calculate current percents
percents:= (Mb*1000) div sizeArc;
ProgressBar.Position:= percents;
ExtractFile.Caption:= FmtMessage(cm('ArcInfo'), [IntToStr(Mb), IntToStr(sizeArc), Format('%.1n', [Abs(percents/10)]), IntToStr(n+1), IntToStr(GetArrayLength(Arcs)) ]);
Position:= Tag + round(ProgressBar.Position * m)

percents:= (Position-Min)/((Max - Min)/1000)
WizardForm.FileNameLabel.Caption:= FmtMessage(cm('AllProgress'), [Format('%.1n', [Abs(percents/10)])]);
if position > 0 then Elapsed:= trunc((GetTickCount - StartInstall) * Abs((max - position)/position)) else Elapsed:= 0;
// Update the taskbar title
if Elapsed = 0 then SetTaskBarTitle(cm('ending')) else SetTaskBarTitle(FmtMessage(cm('remains'), [IntToStr(percents/10), TicksToTime(Elapsed, false)]));
end;
AppProcessMessage;
Result:= CancelCode;
end;

// Extracts all found archives
function UnPack(Archives: string): Integer;
var
allSize: Extended;
callback: longword;
FreeMB, TotalMB: Cardinal;
begin
// Show the 'Cancel unpacking' button and set it as default button
btnCancelUnpacking.Show;
WizardForm.ActiveControl:= btnCancelUnpacking;
WizardForm.ProgressGauge.Position:= 0;
WizardForm.ProgressGauge.Max:= 1000;
// Get the size of all archives
allSize:= FindArcs(Archives);

for n:= 0 to GetArrayLength(Arcs) -1 do
begin
m:= Arcs[n].Size/allSize; // Size of the current archive (îáú¸ì òåêóùåãî àðõèâà)
WizardForm.ProgressGauge.Tag:= WizardForm.ProgressGauge.Position;
CancelCode:= 0;
AppProcessMessage;
callback:= WrapFreeArcCallback(@FreeArcCallback,4); //FreeArcCallback has 4 arguments
try
// Pass the specified arguments to 'unarc.dll'
Result:= FreeArcExtract (callback, 'x', '-o+', '-dp' + AnsiToUtf8( ExpandConstant('{app}') ), '--', Arcs[n].Path, '', '', '', '', '');
if Result = 0 then Result:= CancelCode;
except
Result:= -63; // ArcFail
end;

// Error occured
if Result <> 0 then
begin
msgError:= FmtMessage(cm('ArcError'), [IntToStr(Result)]);
GetSpaceOnDisk(ExtractFileDrive(ExpandConstant('{app}')), True, FreeMB, TotalMB);
case Result of
-1: if FreeMB < 32 {Ìá íà äèñêå} then msgError:= SetupMessage(msgDiskSpaceWarningTitle)
else msgError:= msgError + #13#10 + FmtMessage(cm('ArcBroken'), [ExtractFileName(Arcs[n].Path)]);
-127: msgError:= cm('ArcBreak'); //Cancel button
-63: msgError:= cm('ArcFail');
end;
// MsgBox(msgError, mbInformation, MB_OK); //ñîîáùåíèå ïîêàçûâàåòñÿ íà ñòðàíèöå çàâåðøåíèÿ
Log(msgError);
Break; //ïðåðâàòü öèêë ðàñïàêîâêè
end;
end;
// Hide the button
btnCancelUnpacking.visible:= false;
end;

procedure CurStepChanged(CurStep: TSetupStep);
var
ResultCode:integer;
begin
if CurStep = ssInstall then StartInstall:= GetTickCount; {âðåìÿ íà÷àëà ðàñïàêîâêè}
if CurStep = ssPostInstall then
begin
UnPackError:= UnPack(Archives)
if UnPackError = 0 then begin
{--------------------------------------------------------------------------Äîáàâèë DeKaN(DeKaNszn)--------------------------------------------------------------------------}

{--------------------------------------------------------------------------Äîáàâèë DeKaN(DeKaNszn)--------------------------------------------------------------------------}
SetTaskBarTitle(SetupMessage(msgSetupAppTitle)); end
else
begin
// Error occured, uninstall it then
Exec(ExpandConstant('{uninstallexe}'), '/SILENT','', sw_Hide, ewWaitUntilTerminated, n); //îòêàò óñòàíîâêè èç-çà îøèáêè unarc.dll
SetTaskBarTitle(SetupMessage(msgErrorTitle))
WizardForm.Caption:= SetupMessage(msgErrorTitle) +' — '+ cm('ArcBreak')
end;
end;
end;

// ñòàíäàðòíûé ñïîñîá îòêàòà (íå íóæíà CurPageChanged), íî àðõèâû ðàñïàêîâûâàþòñÿ äî èçâëå÷åíèÿ ôàéëîâ èíñòàëëÿòîðà
// if CurStep = ssInstall then
// if UnPack(Archives) <> 0 then Abort;

Procedure CurPageChanged(CurPageID: Integer);
Begin
PageNameLabel.Caption := WizardForm.PageNameLabel.Caption;
PageDescriptionLabel.Caption := WizardForm.PageDescriptionLabel.Caption;
if (CurPageID = wpFinished) and (UnPackError <> 0) then
begin // ðàñïàêîâùèê âåðíóë îøèáêó
WizardForm.FinishedLabel.Font.Color:= $0000C0; //êðàñíûé
WizardForm.FinishedLabel.Height:= WizardForm.FinishedLabel.Height * 2;
WizardForm.FinishedLabel.Caption:= SetupMessage(msgSetupAborted) + #13#10#13#10 + msgError;
end;
begin
If CurPageID=wpSelectDir then
begin
WizardForm.BackButton.Enabled := False;
end;

if CurPageID=wpSelectDir then begin
WizardForm.NextButton.Caption:='Óñòàíîâèòü';
GetNeedSpaceCaption;
if FreeMB < NeedSize then
WizardForm.NextButton.Enabled:=False
end;
End;
end;
procedure InitializeWizard();
var
WLabel1, WLabel2,
FLabel1, FLabel2: TLabel;
begin
WizardForm.BorderStyle := bsDialog;
ProgressBar:= TNewProgressBar.Create(WizardForm);
ExtractFile:=TNewStaticText.Create(WizardForm);
lblExtractFileName:= TLabel.Create( WizardForm );
with WizardForm.ProgressGauge do
begin
// Create a label to show current FileName being extracted
lblExtractFileName.parent:=WizardForm.InstallingPage;
lblExtractFileName.autosize:=false;
lblExtractFileName.Width:= Width;
lblExtractFileName.top:=Top + ScaleY(35);
lblExtractFileName.Caption:= '';

// Create a label to show percentage
ExtractFile.parent:=WizardForm.InstallingPage;
ExtractFile.autosize:=false;
ExtractFile.Width:= Width;
ExtractFile.top:=lblExtractFileName.Top + ScaleY(16);
ExtractFile.caption:=cm('ArcTitle');

// Create a separate progress bar
ProgressBar.SetBounds(Left, ExtractFile.Top + ScaleY(16), Width, Height);
ProgressBar.Parent:= WizardForm.InstallingPage;
ProgressBar.max:= 1000;
ProgressBar.Position:= 0;
end;

// Create a 'Cancel unpacking' button and hide it for now.
btnCancelUnpacking:=TButton.create(WizardForm);
btnCancelUnpacking.Parent:= WizardForm;
btnCancelUnpacking.SetBounds(260, WizardForm.cancelbutton.top, 135, WizardForm.cancelbutton.Height);
btnCancelUnpacking.OnClick:= @btnCancelUnpackingOnClick;
btnCancelUnpacking.Caption:= cm('ArcCancel');
btnCancelUnpacking.Hide;

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;


dop := TCheckBox.Create(WizardForm);
with Dop do
begin
Parent := WizardForm.SelectDirPage;
Caption := 'Óñòàíîâèòü Game for Windows -LIVE (òðåáóåòñÿ ïîäêëþ÷åíèå ê èíòåðíåòó)';
Left := ScaleX(0);
Top := WizardForm.DirEdit.Top+55;
Width := ScaleX(400);
Height := ScaleY(15);
TabOrder := 0;
Checked := True;
end;


NeedSize := 3220;

WizardForm.DiskSpaceLabel.Hide;

NeedSpaceLabel := TLabel.Create(WizardForm);
with NeedSpaceLabel do
begin
Parent := WizardForm.SelectDirPage;
Left := ScaleX(0);
Top := ScaleY(202);
Width := ScaleX(209);
Height := ScaleY(13);
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;

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 := clWhite;
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 := clWhite;
Transparent := True;
Parent := WizardForm.MainPanel;
end;

with WizardForm do
begin
PageNameLabel.Hide;
PageDescriptionLabel.Hide;
with MainPanel do
begin
with WizardSmallBitmapImage do
begin
Left := ScaleX(0);
Top := ScaleY(0);
Width := Mainpanel.Width;
Height := MainPanel.Height;
end;
end;
end;

WizardForm.WelcomeLabel1.Hide;
WizardForm.WelcomeLabel2.Hide;
WizardForm.FinishedHeadingLabel.Hide;
WizardForm.FinishedLabel.Hide;
WizardForm.WizardBitmapImage.Width := WizardForm.Width;
WizardForm.WizardBitmapImage.Height := WizardForm.Height;
WizardForm.WizardBitmapImage.Width := 497;
WizardForm.WizardBitmapImage.Height := 313;
WizardForm.WizardSmallBitmapImage.Width:=497;
WizardForm.WizardSmallBitmapImage.Height:=58;

WLabel1 := TLabel.Create(WizardForm);
WLabel1.Left := ScaleX(176);
WLabel1.Top := ScaleY(16);
WLabel1.Width := ScaleX(301);
WLabel1.Height := ScaleY(54);
WLabel1.AutoSize := False;
WLabel1.WordWrap := True;
WLabel1.Font.Size := 12;
WLabel1.Font.Style := [fsBold];
WLabel1.Font.Color:= clBlack;
WLabel1.ShowAccelChar := False;
WLabel1.Caption := WizardForm.WelcomeLabel1.Caption;
WLabel1.Transparent := True;
WLabel1.Parent := WizardForm.WelcomePage;

WLabel2 :=TLabel.Create(WizardForm);
WLabel2.Top := ScaleY(76);
WLabel2.Left := ScaleX(176);
WLabel2.Width := ScaleX(301);
WLabel2.Height := ScaleY(234);
WLabel2.AutoSize := False;
WLabel2.WordWrap := True;
WLabel2.Font.Color:= clBlack;
WLabel2.ShowAccelChar := False;
WLabel2.Caption := WizardForm.WelcomeLabel2.Caption;
WLabel2.Transparent := True;
WLabel2.Parent := WizardForm.WelcomePage;

WizardForm.WizardBitmapImage2.Width := WizardForm.Width;
WizardForm.WizardBitmapImage2.Height := WizardForm.Height;

FLabel1 := TLabel.Create(WizardForm);
FLabel1.Left := ScaleX(176);
FLabel1.Top := ScaleY(16);
FLabel1.Width := ScaleX(301);
FLabel1.Height := ScaleY(54);
FLabel1.AutoSize := False;
FLabel1.WordWrap := True;
FLabel1.Font.Size := 12;
FLabel1.Font.Style := [fsBold];
FLabel1.Font.Color:= clBlack;
FLabel1.ShowAccelChar := False;
FLabel1.Caption := WizardForm.FinishedHeadingLabel.Caption;
FLabel1.Transparent := True;
FLabel1.Parent := WizardForm.FinishedPage;

FLabel2 :=TLabel.Create(WizardForm);
FLabel2.Top := ScaleY(76);
FLabel2.Left := ScaleX(176);
FLabel2.Width := ScaleX(301);
FLabel2.Height := ScaleY(53);
FLabel2.AutoSize := False;
FLabel2.WordWrap := True;
FLabel2.Font.Color:= clBlack;
FLabel2.ShowAccelChar := False;
FLabel2.Caption := '' #13#13
'';
FLabel2.Transparent := True;
FLabel2.Parent := WizardForm.FinishedPage;

FLabel1.Caption := WizardForm.FinishedHeadingLabel.Caption;
FLabel1.Transparent := True;
FLabel1.Parent := WizardForm.FinishedPage;
WizardForm.WizardBitmapImage2.Width := 497;
WizardForm.WizardBitmapImage2.Height := 313;
FLabel2 :=TLabel.Create(WizardForm);
FLabel2.Top := ScaleY(76);
FLabel2.Left := ScaleX(176);
FLabel2.Width := ScaleX(301);
FLabel2.Height := ScaleY(53);
FLabel2.AutoSize := False;
FLabel2.WordWrap := True;
FLabel2.Font.Color:= clWhite;
end;



procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
var
Res: Integer;
begin
case CurUninstallStep of
usPostUninstall:
begin
//Ïðîâåðÿåì ïðèñóòñòâèå ïàïêè ïîñëå óäàëåíèÿ
If DirExists(ExpandConstant('{userappdata}\FUEL')) then
//Ñîçäàåì äèàëîã ñ òðåìÿ êíîïêàìè
case MsgBox('Óäàëèòü ñîõðàíåíèÿ è íàñòðîéêè èãðû ?', mbInformation, MB_YESNO) of
IDYES:
begin
if not DelTree(ExpandConstant('{userappdata}\FUEL'), True, True, True) then
MsgBox('Ïàïêà íå óäàëåíà.' #13#13 'Ïàïêà èëè îäèí èç ôàéëîâ â íåé çàäåéñòâîâàíû äðóãèì ïðèëîæåíèåì.', mbError, MB_OK);
end;
IDCANCEL:
begin
Exit;
end;
end;
end;
end;
end;

Serega
06-07-2009, 23:37
Raf-9600, объясните поподробней, как понять работать в невидимом режиме? т.е. вы её запускаете и что вы собрались с ней сделать?

вот только я не могу догадаться что надо добавить там где я отметил жирным и подчеркнул »
Конкретно для вашего случая:
[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

[Code]
var
RunProg: TCheckBox;

procedure CheckBoxChecked;
var
res: Integer;
begin
if RunProg.Checked then
// запускаем gfwlivesetup.exe
Exec(ExpandConstant('{src}\Redistributables\gfwlivesetup.exe'), '',
ExpandConstant('{src}\Redistributables'), SW_HIDE, ewWaitUntilTerminated, res);
end;

procedure GreatCheckBox;
begin
RunProg:= TCheckBox.Create(WizardForm);
with RunProg do
begin
Parent := WizardForm;
Caption := 'Установить программу?';
SetBounds(140,330,150,15);
Cursor:= crHand;
Checked:= True;
end;
end;

procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpFinished then GreatCheckBox;
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssDone then CheckBoxChecked;
end;

p3rf3ct1c
07-07-2009, 00:28
Serega,
Когда я вставляю ваш код в обычный инсталлятор (только что сделанный) без всяких картинок и т.п. то все работает, а тогда я склеиваю ваш код с моим (я его выложил в моем предыдущем сообщении), то в конце все равно не отображается чекбокс.
Не знаете в чем проблема?

Serega
07-07-2009, 00:53
Не знаете в чем проблема? »
Вы совмещайте с одноимёнными процедурами, т.е. CurPageChanged из моего примера с CurPageChanged из вашего скрипта и CurStepChanged соответственно...
/////////////////////////////////////////////////////////////////////////////
procedure CheckBoxChecked;
var
res: Integer;
begin
if RunProg.Checked then
// запускаем gfwlivesetup.exe
Exec(ExpandConstant('{src}\Redistributables\gfwlivesetup.exe'), '',
ExpandConstant('{src}\Redistributables'), SW_HIDE, ewWaitUntilTerminated, res);
end;

procedure GreatCheckBox;
begin
RunProg:= TCheckBox.Create(WizardForm);
with RunProg do
begin
Parent := WizardForm;
Caption := 'Установить программу?';
SetBounds(140,330,150,15);
Cursor:= crHand;
Checked:= True;
end;
end;

procedure CurStepChanged(CurStep: TSetupStep);
var
ResultCode: Integer;
begin
if CurStep = ssInstall then
StartInstall:= GetTickCount; {a?aiy ia?aea ?aniaeiaee}
if CurStep = ssPostInstall then
begin
UnPackError:= UnPack(Archives)
if UnPackError = 0 then
begin
SetTaskBarTitle(SetupMessage(msgSetupAppTitle));
end
else
begin
// Error occured, uninstall it then
Exec(ExpandConstant('{uninstallexe}'), '/SILENT','', sw_Hide, ewWaitUntilTerminated, n); //ioeao onoaiiaee ec-ca ioeaee unarc.dll
SetTaskBarTitle(SetupMessage(msgErrorTitle))
WizardForm.Caption:= SetupMessage(msgErrorTitle) +' — '+ cm('ArcBreak')
end;
end;
if CurStep = ssDone then CheckBoxChecked;
end;

procedure CurPageChanged(CurPageID: Integer);
begin
PageNameLabel.Caption := WizardForm.PageNameLabel.Caption;
PageDescriptionLabel.Caption := WizardForm.PageDescriptionLabel.Caption;

if CurPageID = wpSelectDir then
begin
WizardForm.BackButton.Enabled := False;
WizardForm.NextButton.Caption:='Onoaiiaeou';
GetNeedSpaceCaption;
if FreeMB < NeedSize then
WizardForm.NextButton.Enabled:=False
end;

if (CurPageID = wpFinished) and (UnPackError <> 0) then
begin // ?aniaeiauee aa?ioe ioeaeo
WizardForm.FinishedLabel.Font.Color:= $0000C0; //e?aniue
WizardForm.FinishedLabel.Height:= WizardForm.FinishedLabel.Height * 2;
WizardForm.FinishedLabel.Caption:= SetupMessage(msgSetupAborted) + #13#10#13#10 + msgError;
end;

if CurPageID = wpFinished then GreatCheckBox;
end;
//////////////////////////////////////////////////////////////

Serega
07-07-2009, 01:21
Raf-9600,
[Setup]
AppName=My Program
AppVerName=My Program 1.5
DefaultDirName={pf}\My Program
OutputDir=.
Compression=lzma/ultra
InternalCompressLevel=ultra
SolidCompression=yes

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

[Code]
////////////////////////////////////////////
// Данный скрипт прячет чужую программу
////////////////////////////////////////////

// Отобpажает или пpячет окно обpазом, указанным паpаметpом CmdShow
function ShowWindow(hWnd: HWND; nCmdShow: Integer): BOOL; external 'ShowWindow@user32.dll stdcall';

procedure HideWindow;
var
Wnd, WndEx: THandle;
res, i: Integer;
begin
if FileExists('winmpq\WinMPQ.exe') = True then // проверям наличие файла рядом с инсталлятором
begin
// запускаем файл
if Exec('winmpq\WinMPQ.exe', '', ExpandConstant('{src}\winmpq'), SW_HIDE, ewNoWait, res) then
repeat
if FindWindowByWindowName('WinMPQ') > 0 then
begin
Wnd:= FindWindowByWindowName('WinMPQ');
ShowWindow(Wnd, SW_HIDE); // прячем программу... :)
Break;
end
else i:= i+1;
Sleep(50);
until (Wnd > 0) or (i = 100); // выходим из цикла, если нашли окно или после пяти секунд
// ShowWindow(Wnd, SW_HIDE); // прячем программу... :)
end;
if Wnd > 0 then ShowWindow(Wnd, SW_HIDE); // с первого раза почему-то не всегда срабатывает... :(
end;

procedure InitializeWizard();
begin
HideWindow;
end;

p3rf3ct1c
07-07-2009, 01:36
Serega,
Спасибо все получилось!

Raf-9600
07-07-2009, 09:07
объясните поподробней, как понять работать в невидимом режиме?»
Нужно чтобы окно программы не отображалось. Т.е. чтоб юзер вобще не подозревал что она сечас работает.

т.е. вы её запускаете и что вы собрались с ней сделать? »
Это:
Filename: "{app}\WinMPQ-SU.exe"; Flags: runhidden; Parameters: s Sound.txt; StatusMsg: "Встраивание озвучки юнитов..."; Components: inMPQ; Flags: skipifdoesntexist
Т.е. как минимум, она будет находиться в {app} :)
И под конец инсталляции, будет несколько раз вызываться, для редактирования MPQ архивов. К примеру, с параметром "s Sound.txt" она должна вызываться только после того как отработает:
Filename: "{app}\del Ogg [SoundUnit].bat"; Flags: runhidden; StatusMsg: "Удаление лишних файлов..."; Components: SoundUnit; и т.д.

Пример »
Нужно чтобы WinMPQ запускался не вместе с инсталлятором, а так, какбудто его запуск прописан в [Run]. Просто, как минимум, инсталлятор должен сначала установить, и зарегать библиотеки VB4, чтоб WinMPQ мог запуститься.
И кстати, на данный момент, окно WinMPQ таки отображается.

STRATEG-1992
07-07-2009, 16:21
Подскажите пожалуйста 1 как поменять здесь фон
http://pics.kz/s2/dc/45/4a/2f/dc454a2fc6d9017a3cdea8724a01f70f_preview.jpg (http://pics.kz/viewfull226504),
(просто у меня в предыдущем стоит http://pics.kz/s3/26/e4/3b/da/26e43bda1227f04dce0e281be9c09cb2_preview.jpg (http://pics.kz/viewfull226513) и сюда такоеже надо)
И 2 как переименовать эту кнопку?

Serega
07-07-2009, 23:22
Raf-9600, ещё вопрос, программа запускается с ключами и после завершения работы закрывается сама? или её надо принудительно закрывать?

Raf-9600
08-07-2009, 07:57
Serega, закрывается сама.

upd
Ещё одна просьба: ктонить может объединить эти коды:

Слайд-шоу в окне инсталляции
#define TIME_FOR_VIEW 10

[Setup]
AppName=My Program
AppVerName=My Program v 1.5
DefaultDirName={pf}\My Program
OutputDir=.
Compression=lzma/ultra
SolidCompression=yes

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

[Files]
Source: InnoCallback.dll; Flags: dontcopy noencryption nocompression solidbreak;
Source: *.bmp; Flags: dontcopy noencryption nocompression solidbreak;

Source: D:\Games\StarCraft enGB\StarDat.mpq; DestDir: {app}

[_code]
const
n=21; //количество слайдов
type
TProc = procedure(HandleW, msg, idEvent, TimeSys: LongWord);
TRandNumbers = array[1..N] of byte;

function WrapTimerProc(callback:TProc; paramcount:integer):longword;
external 'wrapcallback@files:InnoCallback.dll stdcall';

function SetTimer(hWnd: LongWord; nIDEvent, uElapse: LongWord; lpTimerFunc: LongWord): LongWord;
external 'SetTimer@user32.dll stdcall';

function KillTimer(hWnd: LongWord; nIDEvent: LongWord): LongWord;
external 'KillTimer@user32.dll stdcall';

function get_unique_random_number(X:byte):TRandNumbers;
var
A,b,c: string;
i,j,k:byte;
begin
For i:=1 to X do A:=A+chr(i);
B:='';
For i:=1 to X do begin
j:=Random(Length(A)-1)+1;
C:='';
B:=B + A[j];
for k:=1 to Length(A) do
if k<>j then C:=C+A[k];
A:=C;
end;
for i:=1 to X do Result[i]:=ord(B[i]);
end;

var
TimerID: LongWord;
currTime: Integer;
SplashImage: TBitmapImage;
StatusMessages: TNewStaticText;
bmp: TRandNumbers;
z:byte;

procedure OnTimer(HandleW, msg, idEvent, TimeSys: LongWord);
begin
currTime := currTime + 1;
if (currTime mod {#TIME_FOR_VIEW} = 0)
then begin
SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Image_'+inttostr(bmp[currTime/{#TIME_FOR_VIEW}])+'.bmp'));
if (currTime/{#TIME_FOR_VIEW} = N) then currTime:=0;
end;
end;


procedure InitializeWizard;
begin
bmp:=get_unique_random_number(N);
ExtractTemporaryFile('Image_'+inttostr(bmp[1])+'.bmp');

currTime := 0;

WizardForm.ProgressGauge.Parent := WizardForm;
WizardForm.ProgressGauge.Top := WizardForm.CancelButton.Top + ScaleY(12);
WizardForm.ProgressGauge.Left := ScaleX(10);
WizardForm.ProgressGauge.Width := WizardForm.MainPanel.Width - ScaleX(20);
WizardForm.ProgressGauge.Height := 16;
WizardForm.ProgressGauge.Hide;

WizardForm.StatusLabel.Parent := WizardForm;
WizardForm.StatusLabel.Top := WizardForm.ProgressGauge.Top - ScaleY(18);
WizardForm.StatusLabel.Left := ScaleX(10);
WizardForm.StatusLabel.Width := ScaleX(397);
WizardForm.StatusLabel.Hide;

SplashImage := TBitmapImage.Create(WizardForm);
SplashImage.Top := 0;
SplashImage.Left := 0;
SplashImage.Width := WizardForm.MainPanel.Width;
SplashImage.Height := WizardForm.Bevel.Top;
SplashImage.Parent := WizardForm.InnerPage;
SplashImage.Stretch := True;
SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Image_'+inttostr(bmp[1])+'.bmp'));
SplashImage.Hide;
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssInstall then
begin
WizardForm.StatusLabel.Caption := 'Распаковка слайдов ...';
for z:=2 to N do ExtractTemporaryFile('Image_'+inttostr(bmp[z])+'.bmp');
end;
end;

procedure CurPageChanged(CurPageID: Integer);
var
pfunc: LongWord;
begin
if (CurPageID = wpInstalling) then
begin
pfunc := WrapTimerProc(@OnTimer, 5);
TimerID := SetTimer(0, 0, 1000, pfunc);
WizardForm.PageNameLabel.Visible := False;
WizardForm.PageDescriptionLabel.Visible := False;
WizardForm.InnerNotebook.Hide;
WizardForm.Bevel1.Hide;
WizardForm.MainPanel.Hide;
WizardForm.PageNameLabel.Hide;
WizardForm.PageDescriptionLabel.Hide;
WizardForm.ProgressGauge.Show;
WizardForm.StatusLabel.Show;
SplashImage.Show;
WizardForm.CancelButton.Enabled := True;
WizardForm.CancelButton.Top := WizardForm.Bevel.Top + ScaleY(100);
end else
begin
WizardForm.ProgressGauge.Hide;
SplashImage.Hide;
WizardForm.FileNameLabel.Hide;
WizardForm.StatusLabel.Hide;
if (CurPageID > wpInstalling) and (CurPageID < wpFinished) then
begin
WizardForm.InnerNotebook.Show;
WizardForm.Bevel1.Show;
WizardForm.MainPanel.Show;
WizardForm.PageNameLabel.Show;
WizardForm.PageDescriptionLabel.Show;
end;
If CurPageID = wpFinished then
end;
end;

procedure DeInitializeSetup();
begin
KillTimer(0, TimerID);
end;
Скрипт для вывода данных о винтах
var
NeedSize:Integer;
FreeMB, TotalMB: Cardinal;
NeedSpaceLabel: TLabel;
n: Integer;
VolumeName, FileSystemName: String;
VolumeSerialNo, MaxComponentLength, FileSystemFlags: Longint;
ListBox: TListBox;
StartMenuTreeView: TStartMenuFolderTreeView;

procedure GetFreeSpaceCaption(Sender: TObject);
var
Path: String;
begin
Path := ExtractFileDrive(WizardForm.DirEdit.Text);
GetSpaceOnDisk(Path, True, FreeMB, TotalMB);
if FreeMB < NeedSize then
WizardForm.NextButton.Enabled := False else
WizardForm.NextButton.Enabled := True; end;

procedure GetNeedSpaceCaption;
begin
if NeedSize > 1024 then
NeedSpaceLabel.Caption := 'Требуется как минимум '+ FloatToStr(round(NeedSize/1024*100)/100) + ' Гб свободного дискового пространства.' else
NeedSpaceLabel.Caption := 'Требуется как минимум '+ IntToStr(NeedSize)+ ' Мб свободного дискового пространства.';end;

const oneMB= 1024*1024;
function GetLogicalDrives: DWord; external 'GetLogicalDrives@kernel32.dll stdcall';
function GetDriveType(nDrive: String): Longint; external 'GetDriveTypeA@kernel32.dll stdcall';
function GetVolumeInformation(PathName,VolumeName: PChar; VolumeNameSize,VolumeSerialNumber,MaxComponentLength,FileSystemFlags: Longint; FileSystemName: PChar; FileSystemNameSize: Longint): Longint; external 'GetVolumeInformationA@kernel32.dll stdcall';
function MessageBox(hWnd: Integer; lpText, lpCaption: String; uType: Cardinal): Integer; external 'MessageBoxA@user32.dll stdcall';

Function ByteOrTB(Bytes: Extended; noMB: Boolean): String; { Перевод числа в значение бт/Кб/Мб/Гб/Тб (до 3х знаков после запятой)}
Begin
if not noMB then Result:= FloatToStr(Int(Bytes)) +' Мб' else
if Bytes < 1024 then Result:= FloatToStr(Int(Bytes)) +' Бт' else
if Bytes/1024 < 1024 then Result:= FloatToStr(round((Bytes/1024)*10)/10) +' Кб' else
If Bytes/oneMB < 1024 then Result:= FloatToStr(round(Bytes/oneMB*100)/100) +' Мб' else
If Bytes/oneMB/1000 < 1024 then Result:= FloatToStr(round(Bytes/oneMB/1024*1000)/1000) +' Гб' else
Result:= FloatToStr(round(Bytes/oneMB/oneMB*1000)/1000) +' Тб'
StringChange(Result, ',', '.')
End;

Function DelSP(String: String): String; { Удаление начальных, конечных и повторных пробелов }
Begin while (Pos(' ', String) > 0) do Delete(String, Pos(' ', String), 1); Result:= Trim(String); End;

Function CutString(String: String; MaxLength: Longint): String; { Обрезать строку до заданного кол-ва символов}
Begin
if Length(String) > MaxLength then Result:= Copy(String, 1, 6) +'...'+ Copy(String, Length(String) - MaxLength +9, MaxLength)
else Result:= String;
End;

Procedure GetDiskInfo(Disk: String);
Begin
FileSystemName:= StringOfChar(' ', 32); VolumeName:= StringOfChar(' ', 256);
GetVolumeInformation(Disk, VolumeName, 255, VolumeSerialNo, MaxComponentLength, FileSystemFlags, FileSystemName, 31);
FileSystemName:= DelSp(FileSystemName); VolumeName:= DelSp(VolumeName); if VolumeName='' then VolumeName:='без метки';
End;

Procedure ListBoxRefresh; var FreeB, TotalB: Cardinal; Path, String: string; Begin
ListBox.Items.Clear
for n:= 1 to 31 do // диск 'А' пропустить
if (GetLogicalDrives and (1 shl n)) > 0 then
if (GetDriveType(Chr(ord('A') + n) +':\') = 2) or (GetDriveType(Chr(ord('A') + n) +':\') = 3) then
if GetSpaceOnDisk(Chr(ord('A') + n) +':\', True, FreeMB, TotalMB) then ListBox.Items.Add(Chr(ord('A') + n) +':');
for n:= 0 to ListBox.Items.Count -1 do begin
Path:= Copy(ListBox.Items[n],1,2) +'\' { если в накопителе нет диска, пропустить обновление }
if GetSpaceOnDisk(Path, False, FreeB, TotalB) and GetSpaceOnDisk(Path, True, FreeMB, TotalMB) then begin GetDiskInfo(Path);
if FreeB >= $7FFFFFFF then String:= PadL(ByteOrTB(FreeMB*oneMB, true),10) else String:= PadL(ByteOrTB(FreeB, true),10);
if TotalB >= $7FFFFFFF then begin TotalB:= TotalMB; FreeB:= FreeMB; String:= PadL(ByteOrTB(TotalMB*oneMB, true),11) +' всего -'+ String end else String:= PadL(ByteOrTB(TotalB, true),11) +' всего| '+ String;
ListBox.Items[n]:= Copy(Path,1,2) + String + PadL(FloatToStr(round(FreeB/TotalB*100)),3)+ '% своб|'+ PadL(FileSystemName,5)+ '| '+ CutString(VolumeName,9); end; end;
End;

Procedure ObjectOnClick(Sender: TObject); Begin
Case TObject(Sender) of
ListBox: for n:= 0 to ListBox.Items.Count-1 do if ListBox.Selected[n] then WizardForm.DirEdit.Text:= Copy(ListBox.Items[n],1,1) +Copy(WizardForm.DirEdit.Text, 2, Length(WizardForm.DirEdit.Text))
StartMenuTreeView: if StartMenuTreeView.Directory <> '' then WizardForm.GroupEdit.Text:= StartMenuTreeView.Directory else WizardForm.GroupEdit.Text:= '{#SetupSetting("DefaultGroupName")}'
WizardForm.NoIconsCheck: begin WizardForm.GroupEdit.Enabled:= not(WizardForm.GroupEdit.Enabled); StartMenuTreeView.Enabled:= WizardForm.GroupEdit.Enabled; WizardForm.GroupBrowseButton.Enabled:= WizardForm.GroupEdit.Enabled end;
end; End;

procedure InitializeWizard();
begin
NeedSize := 6100; //Здесь указывается место для приложения
WizardForm.DiskSpaceLabel.Hide;
NeedSpaceLabel := TLabel.Create(WizardForm);
with NeedSpaceLabel do
begin
Parent := WizardForm.SelectDirPage;
Left := ScaleX(0);
Top := ScaleY(220);
Width := ScaleX(209);
Height := ScaleY(13);
end;
ListBox:= TListBox.Create(WizardForm)
ListBox.SetBounds(WizardForm.DirEdit.Left, WizardForm.DirEdit.Top + WizardForm.DirEdit.Height + 8, WizardForm.DirBrowseButton.Left + WizardForm.DirBrowseButton.Width - WizardForm.DirEdit.Left, WizardForm.DiskSpaceLabel.Top - (WizardForm.DirEdit.Top + WizardForm.DirEdit.Height + 12))
ListBox.Font.Size:= 9
ListBox.Font.Style:= []
ListBox.Font.Name:= 'Courier New';
ListBox.OnClick:= @ObjectOnClick;
ListBox.Parent:= WizardForm.SelectDirPage;
WizardForm.DirEdit.OnChange := @GetFreeSpaceCaption;
WizardForm.DirEdit.Text := WizardForm.DirEdit.Text + #0;
end;

procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID=wpSelectDir then
begin
GetNeedSpaceCaption;
if FreeMB < NeedSize then
WizardForm.NextButton.Enabled:=False
ListBoxRefresh
end;
end;
Описания компонентов
function enabledesc(ComponentsListHandle: HWND; DescLabelHandle: HWND; DescStrings: PChar): BOOL; external 'enabledesc@files:descctrl.dll stdcall';

function disabledesc(): BOOL; external 'disabledesc@files:descctrl.dll stdcall';

var
Info: TNewStaticText;
InfoCaption: TNewStaticText;
InfoPanel: TPanel;

procedure DeinitializeSetup();
begin
disabledesc();
end;

procedure InitializeWizard();
begin
WizardForm.TYPESCOMBO.Visible:= false;
WizardForm.ComponentsList.Height := WizardForm.ComponentsList.Height + WizardForm.ComponentsList.Top - WizardForm.TYPESCOMBO.Top;
WizardForm.ComponentsList.Top := WizardForm.TYPESCOMBO.Top;
WizardForm.ComponentsList.Width := ScaleX(200);
InfoPanel := TPanel.Create(WizardForm);
InfoPanel.Parent := WizardForm.SelectComponentsPage;
InfoPanel.Caption := '';
InfoPanel.Top := WizardForm.ComponentsList.Top;
InfoPanel.Left := ScaleX(216);
InfoPanel.Width := ScaleX(200);
InfoPanel.Height := WizardForm.ComponentsList.Height;
InfoPanel.BevelInner := bvRaised;
InfoPanel.BevelOuter := bvLowered;
InfoCaption := TNewStaticText.Create(WizardForm);
InfoCaption.Parent := WizardForm.SelectComponentsPage;
InfoCaption.Caption := 'ГиКц';
InfoCaption.Left := ScaleX(224);
InfoCaption.Top := InfoPanel.Top - ScaleY(5);
InfoCaption.Font.Color := clActiveCaption;
Info := TNewStaticText.Create(WizardForm);
Info.Parent := InfoPanel;
Info.AutoSize := False;
Info.Left := ScaleX(6);
Info.Width := ScaleX(188);
Info.Top := ScaleY(12);
Info.Height := WizardForm.ComponentsList.Height - ScaleY(18);
Info.Caption := 'Переместите ваш указатель мыши на компоненты чтобы увидеть их описание.';
Info.WordWrap := true;
enabledesc(WizardForm.ComponentsList.Handle,Info.Handle,
'Английская озвучка;'+ // SoundUnit\eng
'Французская озвучка;'+ // SoundUnit\fra
'Немецкая озвучка;'+ // SoundUnit\deu
'Итальянская озвучка;'+ // SoundUnit\ita
'Испанская озвучка;' // SoundUnit\spa
);
end;
Запрет установки в папку Windows
Function NextButtonClick(CurPageID: Integer): Boolean; Begin
Result:= True
if (CurPageID = wpSelectDir) and (Pos(Uppercase(ExpandConstant('{win}')), Uppercase(ExpandConstant('{app}'))) > 0) then Result:= MessageBox(StrToInt(ExpandConstant('{wizardhwnd}')), ExpandConstant('{cm:SysDirSelect}'), 'Установка в системную папку', MB_YESNO or $30) = idYes;
End;
Поиск нужных файлов
function NextButtonClick(CurPageID: Integer): Boolean;
begin
Result := True;

if CurPageID = wpReady then
begin
if IsComponentSelected('Game\Lokal') then
if (FileSearch('Install.exe', ExpandConstant('{app}')) = '') then
if (FileSearch('StarCraft.mpq', ExpandConstant('{app}')) = '') then
begin
SuppressibleMsgBox('Файл Install.exe не найден в папке назначения, скопируйте его с' #13 'лицензионного диска StarCraft, в папку, для начала инсталляции.', mbCriticalError, MB_OK, MB_OK);
Result := False;
end else
Result := True;
end;
end;

upd
И ещё, можно ли заставить Inno, в начале инсталляции, если выбран компонент "Game\Lokal\Backup", заставить запустить виндовское окно копирования файлов, которое бы скопировало некоторые файлы в {app}\Backup?

ALTAIR OC
08-07-2009, 20:08
Вот мой скрипт:
[Setup]
AppName=Fallout 3
AppVerName=Fallout 3
DefaultDirName={pf}\My Program
OutputDir=C:\
WizardImageFile=E:\WizardImageFile.bmp
WizardSmallImageFile=E:\WizardSmallImageFile.bmp


[Languages]
Name: "ENG"; MessagesFile: "compiler:Default.isl"
Name: "RUS"; MessagesFile: "compiler:Languages\Russian.isl"


[Files]
Source: icon.ico; DestDir: {tmp}; Flags: dontcopy

[_code]
Procedure InitializeWizard();
begin
with WizardForm do begin
Position:=poScreenCenter
ClientWidth:=690
ClientHeight:=496
Font.Color:=clWindow
Font.Name:='MS Sans Serif'
Font.Style:=[]
with Bevel do begin
Left:=0
Top:=313
Width:=497
Height:=3
Visible:=False
end
with CancelButton do begin
Left:=600
Top:=462
Width:=77
Height:=25
BringToFront
end
with NextButton do begin
Left:=500
Top:=462
Width:=77
Height:=25
BringToFront
end
with BackButton do begin
Left:=206
Top:=462
Width:=77
Height:=25
BringToFront
end
with OuterNotebook do begin
Left:=0
Top:=0
Width:=690
Height:=496
with WelcomePage do begin
Color:=11232829
with WizardBitmapImage do begin
Left:=0
Top:=0
Width:=690
Height:=496
end
with WelcomeLabel2 do begin
Left:=205
Top:=230
Width:=465
Height:=100 //ïåðâîå îêíî
end
with WelcomeLabel1 do begin
Left:=205
Top:=190
Width:=465
Height:=28
Font.Color:=clWindow
Font.Size:=8
end
end
with InnerPage do begin
with Bevel1 do begin
Left:=0
Top:=58
Width:=499
Height:=3
Visible:=False
end
with InnerNotebook do begin
Left:=205
Top:=79
Width:=465
Height:=354
BringToFront
Color:=11232829 // âòîðîå îêíî(ïóòü óñòàíîâêè)
with LicensePage do begin
with LicenseNotAcceptedRadio do begin
Left:=0
Top:=338
Width:=465
Height:=17
Checked:=True
end
with LicenseAcceptedRadio do begin
Left:=0
Top:=130
Width:=465
Height:=17
end
with LicenseMemo do begin
Left:=0
Top:=38
Width:=465
Height:=266
ReadOnly:=True
ScrollBars:=ssVertical
end
with LicenseLabel1 do begin
Left:=0
Top:=0
Width:=465
Height:=28
end
end
with PasswordPage do begin
with PasswordEdit do begin
Left:=0
Top:=50
Width:=465
Height:=21
Font.Color:=clWindowText
end
with PasswordEditLabel do begin
Left:=0
Top:=34
Width:=465
Height:=14
end
with PasswordLabel do begin
Left:=0
Top:=0
Width:=465
Height:=28
end
end
with InfoBeforePage do begin
with InfoBeforeMemo do begin
Left:=0
Top:=24
Width:=465
Height:=327
ScrollBars:=ssVertical
end
with InfoBeforeClickLabel do begin
Left:=0
Top:=0
Width:=465
Height:=14
end
end
with UserInfoPage do begin
with UserInfoSerialEdit do begin
Left:=0
Top:=120
Width:=465
Height:=21
Font.Color:=clWindowText
end
with UserInfoSerialLabel do begin
Left:=0
Top:=104
Width:=465
Height:=14
end
with UserInfoOrgEdit do begin
Left:=0
Top:=68
Width:=465
Height:=21
Font.Color:=clWindowText
end
with UserInfoOrgLabel do begin
Left:=0
Top:=52
Width:=465
Height:=14
end
with UserInfoNameEdit do begin
Left:=0
Top:=16
Width:=465
Height:=21
Font.Color:=clWindowText
end
with UserInfoNameLabel do begin
Left:=0
Top:=0
Width:=465
Height:=14
end
end
with SelectDirPage do begin
with SelectDirBitmapImage do begin
Left:=0
Top:=0
Width:=32
Height:=32
Visible:=False
end
with DiskSpaceLabel do begin
Left:=0
Top:=340
Width:=465
Height:=14
end
with DirBrowseButton do begin
Left:=388
Top:=288
Width:=77
Height:=25
end
with DirEdit do begin
Left:=0
Top:=290
Width:=378
Height:=21
Font.Color:=clWindowText
end
with SelectDirBrowseLabel do begin
Left:=0
Top:=24
Width:=465
Height:=28
end
with SelectDirLabel do begin
Left:=0
Top:=0
Width:=465
Height:=14
end
end
with SelectComponentsPage do begin
with ComponentsDiskSpaceLabel do begin
Left:=0
Top:=340
Width:=417
Height:=14
end
with ComponentsList do begin
Left:=0
Top:=48
Width:=465
Height:=275
Font.Color:=clWindow
Color:=11232829
end
with TypesCombo do begin
Left:=0
Top:=24
Width:=465
Height:=21
Font.Color:=clWindow
Color:=11232829
end
with SelectComponentsLabel do begin
Left:=0
Top:=0
Width:=465
Height:=14
end
end
with SelectProgramGroupPage do begin
with SelectGroupBitmapImage do begin
Left:=0
Top:=0
Width:=32
Height:=32
Visible:=False
end
with NoIconsCheck do begin
Left:=0
Top:=337
Width:=465
Height:=17
end
with GroupBrowseButton do begin
Left:=388
Top:=288
Width:=77
Height:=25
end
with GroupEdit do begin
Left:=0
Top:=290
Width:=378
Height:=21
Font.Color:=clWindowText
end
with SelectStartMenuFolderBrowseLabel do begin
Left:=0
Top:=24
Width:=465
Height:=28
end
with SelectStartMenuFolderLabel do begin
Left:=0
Top:=0
Width:=465
Height:=14
end
end
with SelectTasksPage do begin
with TasksList do begin
Left:=0
Top:=34
Width:=465
Height:=317
Color:=11232829
end
with SelectTasksLabel do begin
Left:=0
Top:=0
Width:=465
Height:=28
end
end
with ReadyPage do begin
with ReadyMemo do begin
Left:=0
Top:=34
Width:=465
Height:=317
Color:=11232829
end
with ReadyLabel do begin
Left:=0
Top:=0
Width:=465
Height:=28
end
end
with PreparingPage do begin
with PreparingErrorBitmapImage do begin
Left:=0
Top:=0
Width:=16
Height:=16
Visible:=False
end
with PreparingLabel do begin
Left:=24
Top:=0
Width:=393
Height:=14
Visible:=False
end
end
with InstallingPage do begin
with FilenameLabel do begin
Left:=0
Top:=16
Width:=465
Height:=16
end
with StatusLabel do begin
Left:=0
Top:=0
Width:=465
Height:=16
end
with ProgressGauge do begin
Left:=0
Top:=42
Width:=465
Height:=21
Min:=0
Max:=100
end
end
with InfoAfterPage do begin
with InfoAfterMemo do begin
Left:=0
Top:=24
Width:=465
Height:=327
ScrollBars:=ssVertical
end
with InfoAfterClickLabel do begin
Left:=0
Top:=0
Width:=465
Height:=14
end
end
end
with MainPanel do begin
Left:=0
Top:=0
Width:=690
Height:=496
Color:=clWindow
with WizardSmallBitmapImage do begin
Left:=0
Top:=0
Width:=690
Height:=496
BackColor:=clWindow
end
with PageDescriptionLabel do begin
Left:=25
Top:=25
Width:=500
Height:=14
Color:=6697728
Font.Color:=clWindow
end
with PageNameLabel do begin
Left:=15
Top:=7
Width:=500
Height:=14
Color:=6697728
Font.Color:=clWindow
end
end
end
with FinishedPage do begin
Color:=11232829
with WizardBitmapImage2 do begin
Left:=0
Top:=0
Width:=690
Height:=496
end
with NoRadio do begin
Left:=205
Top:=227
Width:=465
Height:=17
end
with YesRadio do begin
Left:=205
Top:=199
Width:=465
Height:=17
end
with RunList do begin
Left:=205
Top:=199
Width:=465
Height:=149
BorderStyle:=bsNone
end
with FinishedLabel do begin
Left:=205
Top:=119
Width:=465
Height:=53
end
with FinishedHeadingLabel do begin
Left:=205
Top:=79
Width:=465
Height:=24
Font.Color:=clWindow
Font.Size:=8
end
end
end
with BeveledLabel do begin
Left:=10
Top:=468
Width:=150
Height:=14
Enabled:=False
Color:=14405068
end
end
end;

Помогите мне его обьединить со след скриптами:

Запуск фоновой картинки во время инстяляции[Setup]
AppName=Background Image
AppVerName=Background Image
CreateAppDir=false

[Files]
Source: BackgroundImage.bmp; DestDir: embedded; Flags: dontcopy noencryption

[_code]
function ShowWindow(hWnd, nCmdShow: LongWord): LongWord; external 'ShowWindow@user32.dll stdcall';

Procedure BackgroundOnActivate(Sender: TObject); Begin if WizardForm.Visible then WizardForm.Show End;

Procedure InitializeWizard;
var BackgroundForm: TForm; BackgroundImage: TBitmapImage;
Begin
BackgroundForm:= TForm.Create(nil)
BackgroundForm.BorderStyle:= bsNone
BackgroundForm.OnActivate:= @BackgroundOnActivate;
ShowWindow(BackgroundForm.Handle, sw_ShowMaximized) // ôîíîâîå îêíî íà ïîëíûé ýêðàí
BackgroundImage:= TBitmapImage.Create(BackgroundForm)
BackgroundImage.Align:= alClient
BackgroundImage.Stretch:= True
ExtractTemporaryFile('BackgroundImage.bmp')
BackgroundImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\BackgroundImage.bmp'))
BackgroundImage.Parent:= BackgroundForm
end;

Позволяет выбрать иконку инсталятора
[Setup]
AppName=CheckFile
AppVerName=CheckFile
DefaultDirName={pf}\CheckFile
OutputDir=.
DirExistsWarning=no

[Files]
Source: icon.ico; DestDir: {tmp}; Flags: dontcopy

[_code]
function LoadImage(hInst: THandle; ImageName: PChar; ImageType: UINT; X, Y: Integer; Flags: UINT): THandle; external 'LoadImageA@user32.dll stdcall delayload';

Procedure InitializeWizard;
Begin
ExtractTemporaryFile('icon.ico');
SendMessage(WizardForm.Handle, $80, 0, LoadImage(0,ExpandConstant('{tmp}')+'\icon.ico',1,16,16,$1010));
End;

ALTAIR OC
08-07-2009, 20:16
Cкрипт для распаковки arc архивов

;[English]
;Example of using unarc.dll for decompression of FreeArc archives with displaying of progress indicator in Inno Setup window
;
;[Russian]
;Пример распаковки FreeArc архива при помощи unarc.dll, с отображением прогресс бара в окне Inno Setup.
;Один архив можно слить с инсталятором, если их общий размер не более 2Гб, через "copy /b setup.exe+xxx.arc newsetup.exe" и указать в коде Archives = '{srcexe}'
;
; Изменения от Victor_Dobrov, 02-07-2009
; - Кнопка инсталлятора в панели задач отображает время до завершения обработки всех архивов и общий процент распаковки.
; - в Unicode-версиях инсталлятора правильно отображаются имена файлов.
;
; Изменения от CTACKo & SotM'а. 01-07-2009
; - Правильно создаются папки, если в пути установки встречаются русские буквы
; - При компиляции определяется использование PAnsiChar/PChar. Можно использовать как обычную так и UNICODE версию с установленным препроцессором.
;
; Изменения от SotM'а. 23-06-2009
; - Нижний прогресс бар сместил чуть-чуть вниз, чтобы было видно имя распаковываемого файла.
; - Русские имена файлов теперь правильно отображаются.
; - При нажатии "отмены" при распаковке теперь появляется запрос на подтверждение отмены.
; - Переименовал некоторые переменные, чтобы их имена несли больше информации.
; - Немного переформатировал сам исходный код для более удобного и понятного чтения.
; - Исправил пару сообщений на английском языке.

; Изменения от Victor_Dobrov, 15-06-2009
; - оптимизация и локализация скрипта, более подробная строка статуса, общий прогресс-бар, при неудачной распаковке выполняется откат (деинсталляция) и показывается текст ошибки.

; Bulat Ziganshin, 13-06-2009
; - создание библиотеки unarc.dll и скрипта распаковки freearc_example.iss.

[Setup]
AppName=FreeArc Example
AppVerName=FreeArc Example 1.2
DefaultDirName={pf}\FreeArc Example
UsePreviousAppDir=false
DirExistsWarning=no
ShowLanguageDialog=auto
OutputBaseFilename=FreeArcExample
OutputDir=.
VersionInfoCopyright=Bulat Ziganshin, Victor Dobrov, SotM, CTACKo

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

[CustomMessages]
eng.ArcCancel=Cancel installation
eng.ArcBreak=Installation cancelled!
eng.ArcInfo=Extracted %1 Mb of %2 Mb (%3%%). Archive: %4 of %5.
eng.ArcTitle=Extracting FreeArc archive
eng.ArcError=Decompression failed with error code %1
eng.ArcFail=Decompression failed!
eng.AllProgress=Overall extraction progress: %1%%
eng.ArcBroken=Archive %1 is damaged%nor not enough free space.
eng.Extracting=Extracting: %1
eng.remains=%1%%, %2 elapsed
eng.LongTime=at no time
eng.ending=ending

rus.ArcCancel=Отменить распаковку
rus.ArcBreak=Установка прервана!
rus.ArcInfo=Распаковано %1 Мб из %2 Мб (%3%%). Архив: %4 из %5.
rus.ArcTitle=Распаковка архивов FreeArc
rus.ArcError=Распаковщик FreeArc вернул код ошибки: %1
rus.ArcFail=Распаковка не завершена!
rus.AllProgress=Общий прогресс распаковки: %1%%
rus.ArcBroken=Возможно, архив %1 повреждён%nили недостаточно места на диске назначения.
rus.Extracting=Распаковывается: %1
rus.remains=%1%%, жди %2
rus.LongTime=вечно
rus.ending=завершение

[Files]
;Source: *.arc; DestDir: {app}; Flags: nocompression
Source: unarc.dll; DestDir: {tmp}; Flags: dontcopy deleteafterinstall
Source: compiler:InnoCallback.dll; DestDir: {tmp}; Flags: dontcopy

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

[_code]
const
Archives = '{src}\*.arc'; // укажите расположение архивов FreeArc; для внешних файлов строку в [Files] добавлять необязательно

PM_REMOVE = 1;
CP_ACP = 0; CP_UTF8 = 65001;

type
#ifdef UNICODE ; если у вас ошибка на этой строке, то установите препроцессор или исправьте скрипт для вашей версии Inno Setup
#define A "W"
#else
#define A "A" ; точка входа в SetWindowText, {#A} меняется на A или W в зависимости от версии
PAnsiChar = PChar; // Required for Inno Setup 5.3.0 and higher. (требуется для Inno Setup версии 5.3.0 и ниже)
#endif
#if Ver < 84018176
AnsiString = String; // There is no need for this line in Inno Setup 5.2.4 and below (для Inno Setup версий 5.2.4 и выше эта строка не нужна)
#endif

TMyMsg = record
hwnd: HWND;
message: UINT;
wParam: Longint;
lParam: Longint;
time: DWORD;
pt: TPoint;
end;

TFreeArcCallback = function (what: PAnsiChar; int1, int2: Integer; str: PAnsiChar): Integer;
TArc = record Path: string; Size: Extended; end;

var
ProgressBar: TNewProgressBar;
ExtractFile: TNewStaticText;
lblExtractFileName: TLabel;
btnCancelUnpacking: TButton;
CancelCode, n, UnPackError, StartInstall: Integer;
Arcs: array of TArc;
msgError: string;
m: Extended;

Function MultiByteToWideChar(CodePage: UINT; dwFlags: DWORD; lpMultiByteStr: string; cbMultiByte: integer; lpWideCharStr: string; cchWideChar: integer): longint; external 'MultiByteToWideChar@kernel32.dll stdcall';
Function WideCharToMultiByte(CodePage: UINT; dwFlags: DWORD; lpWideCharStr: string; cchWideChar: integer; lpMultiByteStr: string; cbMultiByte: integer; lpDefaultChar: integer; lpUsedDefaultChar: integer): longint; external 'WideCharToMultiByte@kernel32.dll stdcall';

function PeekMessage(var lpMsg: TMyMsg; hWnd: HWND; wMsgFilterMin, wMsgFilterMax, wRemoveMsg: UINT): BOOL; external 'PeekMessageA@user32.dll stdcall';
function TranslateMessage(const lpMsg: TMyMsg): BOOL; external 'TranslateMessage@user32.dll stdcall';
function DispatchMessage(const lpMsg: TMyMsg): Longint; external 'DispatchMessageA@user32.dll stdcall';

Function OemToChar(lpszSrc, lpszDst: AnsiString): longint; external 'OemToCharA@user32.dll stdcall';
function GetWindowLong(hWnd, nIndex: Integer): Longint; external 'GetWindowLongA@user32 stdcall delayload';
function SetWindowText(hWnd: Longint; lpString: String): Longint; external 'SetWindowText{#A}@user32 stdcall delayload';

function GetTickCount: DWord; external 'GetTickCount@kernel32';
function WrapFreeArcCallback (callback: TFreeArcCallback; paramcount: integer):longword; external 'wrapcallback@files:innocallback.dll stdcall';
function FreeArcExtract (callback: longword; cmd1,cmd2,cmd3,cmd4,cmd5,cmd6,cmd7,cmd8,cmd9,cmd10: PAnsiChar): integer; external 'FreeArcExtract@files:unarc.dll cdecl';

procedure AppProcessMessage;
var
Msg: TMyMsg;
begin
while PeekMessage(Msg, WizardForm.Handle, 0, 0, PM_REMOVE) do begin
TranslateMessage(Msg);
DispatchMessage(Msg);
end;
end;

Function NumToStr(Float: Extended): String; {Перевод числа в строку с точностью 3 знака (%.3n) с округлением дробной части, если она есть}
Begin
Result:= Format('%.3n', [Float]); StringChange(Result, ',', '.'); while ((Result[Length(Result)] = '0') or (Result[Length(Result)] = '.')) and (Length(Result) > 1) do SetLength(Result, Length(Result)-1);
End;

function cm(Message: String): String; Begin Result:= ExpandConstant('{cm:'+ Message +'}') End;

Function Size64(Hi, Lo: Integer): Extended;
Begin
Result:= Lo; if Lo< 0 then Result:= Result + $7FFFFFFF + $7FFFFFFF + 2; for Hi:= Hi-1 Downto 0 do Result:= Result + $7FFFFFFF + $7FFFFFFF + 2;
End;

// OnClick event function for btnCancel
procedure btnCancelUnpackingOnClick(Sender: TObject);
begin
if MsgBox( SetupMessage( msgExitSetupMessage ), mbInformation, MB_YESNO ) = IDYES then
CancelCode:= -127;
end;

// Scans the specified folders for archives and add them to list
function FindArcs(dir: string): Extended;
var
FSR: TFindRec;
Begin
if FindFirst(ExpandConstant(dir), FSR) then
try
repeat
// Skip everything but the folders
if FSR.Attributes and FILE_ATTRIBUTE_DIRECTORY > 0 then CONTINUE;
n:= GetArrayLength(Arcs);
// Expand the folder list
SetArrayLength(Arcs, n +1);
Arcs[n].Path:= ExtractFilePath(ExpandConstant(Archives)) + FSR.Name;
Arcs[n].Size:= Size64(FSR.SizeHigh, FSR.SizeLow);
Result:= Result + Arcs[n].Size;
until not FindNext(FSR);
finally
FindClose(FSR);
end;
End;

// Converts OEM encoded string into ANSI
// Преобразует OEM строку в ANSI кодировку
function OemToAnsiStr( strSource: AnsiString): AnsiString;
var
nRet : longint;
begin
SetLength( Result, Length( strSource ) );
nRet:= OemToChar( strSource, Result );
end;

// Converts ANSI encoded string into UTF-8
// Преобразует строку из ANSI в UTF-8 кодировку
function AnsiToUtf8( strSource: string ): string;
var
nRet : integer;
WideCharBuf: string;
MultiByteBuf: string;
begin
strSource:= strSource + chr(0);
SetLength( WideCharBuf, Length( strSource ) * 2 );
SetLength( MultiByteBuf, Length( strSource ) * 2 );

nRet:= MultiByteToWideChar( CP_ACP, 0, strSource, -1, WideCharBuf, Length(WideCharBuf) );
nRet:= WideCharToMultiByte( CP_UTF8, 0, WideCharBuf, -1, MultiByteBuf, Length(MultiByteBuf), 0, 0);

Result:= MultiByteBuf;
end;

// Sets the TaskBar title
Procedure SetTaskBarTitle(Title: String); var h: Integer;
Begin
h:= GetWindowLong(MainForm.Handle, -8); if h <> 0 then SetWindowText(h, Title);
End;

// Converts milliseconds to standart time
Function TicksToTime(Ticks: DWord; detail: Boolean): String; Begin {милисекунды в стандартное время}
if detail or (Ticks/3600 >= 1000) {hour} then if Ticks/3600000 > 23 then Result:= cm('LongTime') else Result:= PADZ(IntToStr(Ticks/3600000), 2) +':'+ PADZ(IntToStr((Ticks/1000 - Ticks/1000/3600*3600)/60), 2) +':'+ PADZ(IntToStr(Ticks/1000 - Ticks/1000/60*60), 2) else if Ticks/60 < 1000 {min} then Result:= IntToStr(Ticks/1000) +'.'+ NumToStr(trunc((Ticks/1000 - trunc(Ticks/1000))*10)) +'s' else Result:= IntToStr(Ticks/60000) +'m '+ PADZ(IntToStr(Ticks/1000 - Ticks/1000/60*60), 2) +'s';
End;

// The main callback function for unpacking FreeArc archives
function FreeArcCallback (what: PAnsiChar; Mb, sizeArc: Integer; str: PAnsiChar): Integer;
var
percents, Elapsed: Integer;
begin
if string(what)='filename' then
// Update FileName label
lblExtractFileName.Caption:= FmtMessage( cm( 'Extracting' ), [OemToAnsiStr( str )] )
else
if (string(what)='progress') and (sizeArc>0) then
// Update progress bar with additional info
with WizardForm.ProgressGauge do
begin
// Calculate current percents
percents:= (Mb*1000) div sizeArc;
ProgressBar.Position:= percents;
ExtractFile.Caption:= FmtMessage(cm('ArcInfo'), [IntToStr(Mb), IntToStr(sizeArc), Format('%.1n', [Abs(percents/10)]), IntToStr(n+1), IntToStr(GetArrayLength(Arcs)) ]);
Position:= Tag + round(ProgressBar.Position * m)

percents:= (Position-Min)/((Max - Min)/1000)
WizardForm.FileNameLabel.Caption:= FmtMessage(cm('AllProgress'), [Format('%.1n', [Abs(percents/10)])]);
if position > 0 then Elapsed:= trunc((GetTickCount - StartInstall) * Abs((max - position)/position)) else Elapsed:= 0;
// Update the taskbar title
if Elapsed = 0 then SetTaskBarTitle(cm('ending')) else SetTaskBarTitle(FmtMessage(cm('remains'), [IntToStr(percents/10), TicksToTime(Elapsed, false)]));
end;
AppProcessMessage;
Result:= CancelCode;
end;

// Extracts all found archives
function UnPack(Archives: string): Integer;
var
allSize: Extended;
callback: longword;
FreeMB, TotalMB: Cardinal;
begin
// Show the 'Cancel unpacking' button and set it as default button
btnCancelUnpacking.Show;
WizardForm.ActiveControl:= btnCancelUnpacking;
WizardForm.ProgressGauge.Position:= 0;
WizardForm.ProgressGauge.Max:= 1000;
// Get the size of all archives
allSize:= FindArcs(Archives);

for n:= 0 to GetArrayLength(Arcs) -1 do
begin
m:= Arcs[n].Size/allSize; // Size of the current archive (объём текущего архива)
WizardForm.ProgressGauge.Tag:= WizardForm.ProgressGauge.Position;
CancelCode:= 0;
AppProcessMessage;
callback:= WrapFreeArcCallback(@FreeArcCallback,4); //FreeArcCallback has 4 arguments
try
// Pass the specified arguments to 'unarc.dll'
Result:= FreeArcExtract (callback, 'x', '-o+', '-dp' + AnsiToUtf8( ExpandConstant('{app}') ), '--', Arcs[n].Path, '', '', '', '', '');
if Result = 0 then Result:= CancelCode;
except
Result:= -63; // ArcFail
end;

// Error occured
if Result <> 0 then
begin
msgError:= FmtMessage(cm('ArcError'), [IntToStr(Result)]);
GetSpaceOnDisk(ExtractFileDrive(ExpandConstant('{app}')), True, FreeMB, TotalMB);
case Result of
-1: if FreeMB < 32 {Мб на диске} then msgError:= SetupMessage(msgDiskSpaceWarningTitle)
else msgError:= msgError + #13#10 + FmtMessage(cm('ArcBroken'), [ExtractFileName(Arcs[n].Path)]);
-127: msgError:= cm('ArcBreak'); //Cancel button
-63: msgError:= cm('ArcFail');
end;
// MsgBox(msgError, mbInformation, MB_OK); //сообщение показывается на странице завершения
Log(msgError);
Break; //прервать цикл распаковки
end;
end;
// Hide the button
btnCancelUnpacking.visible:= false;
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssInstall then StartInstall:= GetTickCount; {время начала распаковки}
if CurStep = ssPostInstall then
begin
UnPackError:= UnPack(Archives)
if UnPackError = 0 then
SetTaskBarTitle(SetupMessage(msgSetupAppTitle))
else
begin
// Error occured, uninstall it then
Exec(ExpandConstant('{uninstallexe}'), '/SILENT','', sw_Hide, ewWaitUntilTerminated, n); //откат установки из-за ошибки unarc.dll
SetTaskBarTitle(SetupMessage(msgErrorTitle))
WizardForm.Caption:= SetupMessage(msgErrorTitle) +' — '+ cm('ArcBreak')
end;
end;
end;

// стандартный способ отката (не нужна CurPageChanged), но архивы распаковываются до извлечения файлов инсталлятора
// if CurStep = ssInstall then
// if UnPack(Archives) <> 0 then Abort;

Procedure CurPageChanged(CurPageID: Integer);
Begin
if (CurPageID = wpFinished) and (UnPackError <> 0) then
begin // распаковщик вернул ошибку
WizardForm.FinishedLabel.Font.Color:= $0000C0; //красный
WizardForm.FinishedLabel.Height:= WizardForm.FinishedLabel.Height * 2;
WizardForm.FinishedLabel.Caption:= SetupMessage(msgSetupAborted) + #13#10#13#10 + msgError;
end;
End;

procedure InitializeWizard();
begin
ProgressBar:= TNewProgressBar.Create(WizardForm);
ExtractFile:=TNewStaticText.Create(WizardForm);
lblExtractFileName:= TLabel.Create( WizardForm );
with WizardForm.ProgressGauge do
begin
// Create a label to show current FileName being extracted
lblExtractFileName.parent:=WizardForm.InstallingPage;
lblExtractFileName.autosize:=false;
lblExtractFileName.Width:= Width;
lblExtractFileName.top:=Top + ScaleY(35);
lblExtractFileName.Caption:= '';

// Create a label to show percentage
ExtractFile.parent:=WizardForm.InstallingPage;
ExtractFile.autosize:=false;
ExtractFile.Width:= Width;
ExtractFile.top:=lblExtractFileName.Top + ScaleY(16);
ExtractFile.caption:=cm('ArcTitle');

// Create a separate progress bar
ProgressBar.SetBounds(Left, ExtractFile.Top + ScaleY(16), Width, Height);
ProgressBar.Parent:= WizardForm.InstallingPage;
ProgressBar.max:= 1000;
ProgressBar.Position:= 0;
end;

// Create a 'Cancel unpacking' button and hide it for now.
btnCancelUnpacking:=TButton.create(WizardForm);
btnCancelUnpacking.Parent:= WizardForm;
btnCancelUnpacking.SetBounds(260, WizardForm.cancelbutton.top, 135, WizardForm.cancelbutton.Height);
btnCancelUnpacking.OnClick:= @btnCancelUnpackingOnClick;
btnCancelUnpacking.Caption:= cm('ArcCancel');
btnCancelUnpacking.Hide;
end;

Скрипт для вывода данных о винтах

var
NeedSize:Integer;
FreeMB, TotalMB: Cardinal;
NeedSpaceLabel: TLabel;
n: Integer;
VolumeName, FileSystemName: String;
VolumeSerialNo, MaxComponentLength, FileSystemFlags: Longint;
ListBox: TListBox;
StartMenuTreeView: TStartMenuFolderTreeView;

procedure GetFreeSpaceCaption(Sender: TObject);
var
Path: String;
begin
Path := ExtractFileDrive(WizardForm.DirEdit.Text);
GetSpaceOnDisk(Path, True, FreeMB, TotalMB);
if FreeMB < NeedSize then
WizardForm.NextButton.Enabled := False else
WizardForm.NextButton.Enabled := True; end;

procedure GetNeedSpaceCaption;
begin
if NeedSize > 1024 then
NeedSpaceLabel.Caption := 'Требуется как минимум '+ FloatToStr(round(NeedSize/1024*100)/100) + ' Гб свободного дискового пространства.' else
NeedSpaceLabel.Caption := 'Требуется как минимум '+ IntToStr(NeedSize)+ ' Мб свободного дискового пространства.';end;

const oneMB= 1024*1024;
function GetLogicalDrives: DWord; external 'GetLogicalDrives@kernel32.dll stdcall';
function GetDriveType(nDrive: String): Longint; external 'GetDriveTypeA@kernel32.dll stdcall';
function GetVolumeInformation(PathName,VolumeName: PChar; VolumeNameSize,VolumeSerialNumber,MaxComponentLength,FileSystemFlags: Longint; FileSystemName: PChar; FileSystemNameSize: Longint): Longint; external 'GetVolumeInformationA@kernel32.dll stdcall';
function MessageBox(hWnd: Integer; lpText, lpCaption: String; uType: Cardinal): Integer; external 'MessageBoxA@user32.dll stdcall';

Function ByteOrTB(Bytes: Extended; noMB: Boolean): String; { Перевод числа в значение бт/Кб/Мб/Гб/Тб (до 3х знаков после запятой)}
Begin
if not noMB then Result:= FloatToStr(Int(Bytes)) +' Мб' else
if Bytes < 1024 then Result:= FloatToStr(Int(Bytes)) +' Бт' else
if Bytes/1024 < 1024 then Result:= FloatToStr(round((Bytes/1024)*10)/10) +' Кб' else
If Bytes/oneMB < 1024 then Result:= FloatToStr(round(Bytes/oneMB*100)/100) +' Мб' else
If Bytes/oneMB/1000 < 1024 then Result:= FloatToStr(round(Bytes/oneMB/1024*1000)/1000) +' Гб' else
Result:= FloatToStr(round(Bytes/oneMB/oneMB*1000)/1000) +' Тб'
StringChange(Result, ',', '.')
End;

Function DelSP(String: String): String; { Удаление начальных, конечных и повторных пробелов }
Begin while (Pos(' ', String) > 0) do Delete(String, Pos(' ', String), 1); Result:= Trim(String); End;

Function CutString(String: String; MaxLength: Longint): String; { Обрезать строку до заданного кол-ва символов}
Begin
if Length(String) > MaxLength then Result:= Copy(String, 1, 6) +'...'+ Copy(String, Length(String) - MaxLength +9, MaxLength)
else Result:= String;
End;

Procedure GetDiskInfo(Disk: String);
Begin
FileSystemName:= StringOfChar(' ', 32); VolumeName:= StringOfChar(' ', 256);
GetVolumeInformation(Disk, VolumeName, 255, VolumeSerialNo, MaxComponentLength, FileSystemFlags, FileSystemName, 31);
FileSystemName:= DelSp(FileSystemName); VolumeName:= DelSp(VolumeName); if VolumeName='' then VolumeName:='без метки';
End;

Procedure ListBoxRefresh; var FreeB, TotalB: Cardinal; Path, String: string; Begin
ListBox.Items.Clear
for n:= 1 to 31 do // диск 'А' пропустить
if (GetLogicalDrives and (1 shl n)) > 0 then
if (GetDriveType(Chr(ord('A') + n) +':\') = 2) or (GetDriveType(Chr(ord('A') + n) +':\') = 3) then
if GetSpaceOnDisk(Chr(ord('A') + n) +':\', True, FreeMB, TotalMB) then ListBox.Items.Add(Chr(ord('A') + n) +':');
for n:= 0 to ListBox.Items.Count -1 do begin
Path:= Copy(ListBox.Items[n],1,2) +'\' { если в накопителе нет диска, пропустить обновление }
if GetSpaceOnDisk(Path, False, FreeB, TotalB) and GetSpaceOnDisk(Path, True, FreeMB, TotalMB) then begin GetDiskInfo(Path);
if FreeB >= $7FFFFFFF then String:= PadL(ByteOrTB(FreeMB*oneMB, true),10) else String:= PadL(ByteOrTB(FreeB, true),10);
if TotalB >= $7FFFFFFF then begin TotalB:= TotalMB; FreeB:= FreeMB; String:= PadL(ByteOrTB(TotalMB*oneMB, true),11) +' всего -'+ String end else String:= PadL(ByteOrTB(TotalB, true),11) +' всего| '+ String;
ListBox.Items[n]:= Copy(Path,1,2) + String + PadL(FloatToStr(round(FreeB/TotalB*100)),3)+ '% своб|'+ PadL(FileSystemName,5)+ '| '+ CutString(VolumeName,9); end; end;
End;

Procedure ObjectOnClick(Sender: TObject); Begin
Case TObject(Sender) of
ListBox: for n:= 0 to ListBox.Items.Count-1 do if ListBox.Selected[n] then WizardForm.DirEdit.Text:= Copy(ListBox.Items[n],1,1) +Copy(WizardForm.DirEdit.Text, 2, Length(WizardForm.DirEdit.Text))
StartMenuTreeView: if StartMenuTreeView.Directory <> '' then WizardForm.GroupEdit.Text:= StartMenuTreeView.Directory else WizardForm.GroupEdit.Text:= '{#SetupSetting("DefaultGroupName")}'
WizardForm.NoIconsCheck: begin WizardForm.GroupEdit.Enabled:= not(WizardForm.GroupEdit.Enabled); StartMenuTreeView.Enabled:= WizardForm.GroupEdit.Enabled; WizardForm.GroupBrowseButton.Enabled:= WizardForm.GroupEdit.Enabled end;
end; End;

procedure InitializeWizard();
begin
NeedSize := 6100; //Здесь указывается место для приложения
WizardForm.DiskSpaceLabel.Hide;
NeedSpaceLabel := TLabel.Create(WizardForm);
with NeedSpaceLabel do
begin
Parent := WizardForm.SelectDirPage;
Left := ScaleX(0);
Top := ScaleY(220);
Width := ScaleX(209);
Height := ScaleY(13);
end;
ListBox:= TListBox.Create(WizardForm)
ListBox.SetBounds(WizardForm.DirEdit.Left, WizardForm.DirEdit.Top + WizardForm.DirEdit.Height + 8, WizardForm.DirBrowseButton.Left + WizardForm.DirBrowseButton.Width - WizardForm.DirEdit.Left, WizardForm.DiskSpaceLabel.Top - (WizardForm.DirEdit.Top + WizardForm.DirEdit.Height + 12))
ListBox.Font.Size:= 9
ListBox.Font.Style:= []
ListBox.Font.Name:= 'Courier New';
ListBox.OnClick:= @ObjectOnClick;
ListBox.Parent:= WizardForm.SelectDirPage;
WizardForm.DirEdit.OnChange := @GetFreeSpaceCaption;
WizardForm.DirEdit.Text := WizardForm.DirEdit.Text + #0;
end;

procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID=wpSelectDir then
begin
GetNeedSpaceCaption;
if FreeMB < NeedSize then
WizardForm.NextButton.Enabled:=False
ListBoxRefresh
end;
end;

Этот скрипт нужен для того чтобы можно было ставить чекбоксы(создания ярлыка на раб столе, установка DX и.т.д)

[_code]
// Эти знчения привязываются к файлам и иконкам
function InstallDirectX: Boolean;
begin
Result:= DirectX.Checked;
end;

function InstallRedist: Boolean;
begin
Result:=Redist.Checked;
end;

function CreateIcons: Boolean;
begin
Result:=Icons.Checked;
end;

function GroupIcons: Boolean;
begin
Result:=Group.Checked;
end;
// задал процедуру, чтоб отмечался чебокс еси кликнуть по надписи lblCheckBox
procedure lblRedistOnClick(Sender: TObject);
begin
if Redist.Checked = False then
Redist.Checked:= True else
Redist.Checked:= False;
end;

procedure lblDirectXOnClick(Sender: TObject);
begin
if DirectX.Checked = False then
DirectX.Checked:= True else
DirectX.Checked:= False;
end;

procedure IconsOnClick(Sender: TObject);
begin
if Icons.Checked = False then
Icons.Checked:= True else
Icons.Checked:= False;
end;

procedure GroupOnClick(Sender: TObject);
begin
if Group.Checked = False then
Group.Checked:= True else
Group.Checked:= False;
end;
// Сами чекбоксы и лейблы к ним
procedure InitializeWizard();
DirectX:= TCheckBox.Create(WizardForm);
with DirectX do
begin
Parent:= WizardForm.SelectDirPage;
Left:= WizardForm.DirEdit.Left + 200;
Top:= WizardForm.DirEdit.Top + 35;
Width:= ScaleX(14);
Height:= ScaleY(14);
TabOrder:= 0;
Checked:= False;
end;

// создаём надпись для CheckBox'а
lblDirectX:= TLabel.Create(WizardForm);
with lblDirectX do
begin
Caption:= ExpandConstant('{cm:DRT}');
Left:= WizardForm.DirEdit.Left + 220;
Top:= WizardForm.DirEdit.Top + 35;
Width:= ScaleX(150);
Height:= ScaleY(13);
Transparent := True;
Parent:= WizardForm.SelectDirPage;
OnClick:= @lblDirectXOnClick;
end;

Redist:= TCheckBox.Create(WizardForm);
with Redist do
begin
Parent:= WizardForm.SelectDirPage;
Left:= WizardForm.DirEdit.Left + 200;
Top:= WizardForm.DirEdit.Top + 70;
Width:= ScaleX(14);
Height:= ScaleY(14);
TabOrder:= 1;
Checked:= False;
end;

lblRedist:= TLabel.Create(WizardForm);
with lblRedist do
begin
Caption:='Установить MS Visual C++ 2005';
Left:= WizardForm.DirEdit.Left + 220;
Top:= WizardForm.DirEdit.Top + 70;
Width:= ScaleX(150);
Height:= ScaleY(13);
Transparent := True;
Parent:= WizardForm.SelectDirPage;
OnClick:= @lblRedistOnClick;
end;

Icons:= TCheckBox.Create(WizardForm);
with Icons do
begin
Parent:= WizardForm.SelectDirPage;
Left:= WizardForm.DirEdit.Left;
Top:= WizardForm.DirEdit.Top + 35;
Width:= ScaleX(14);
Height:= ScaleY(14);
TabOrder:= 2;
Checked:= False;
end;

lblIcons:= TLabel.Create(WizardForm);
with lblIcons do
begin
Caption:='Создать ярлык на рабочем столе';
Left:= WizardForm.DirEdit.Left + 20;
Top:= WizardForm.DirEdit.Top + 35;
Width:= ScaleX(150);
Height:= ScaleY(13);
Transparent := True;
Parent:= WizardForm.SelectDirPage;
OnClick:= @IconsOnClick;
end;

Group:= TCheckBox.Create(WizardForm);
with Group do
begin
Parent:= WizardForm.SelectDirPage;
Left:= WizardForm.DirEdit.Left;
Top:= WizardForm.DirEdit.Top + 70;
Width:= ScaleX(14);
Height:= ScaleY(14);
TabOrder:= 3;
Checked:= False;
end;

lblGroup:= TLabel.Create(WizardForm);
with lblGroup do
begin
Caption:='Создать ярлыки в меню "Пуск"';
Left:= WizardForm.DirEdit.Left + 20;
Top:= WizardForm.DirEdit.Top + 70;
Width:= ScaleX(150);
Height:= ScaleY(13);
Transparent := True;
Parent:= WizardForm.SelectDirPage;
OnClick:= @GroupOnClick;
end;

Как сделать чтоб под текстом был не синий фон а прозрачный
http://imageshost.ru/links/64f37ed02b9edcfa1761ef008858a88a

И как нибудь прикруть проверку системы(что за проц, ОС, ОЗУ)
http://victor-dobrov.narod.ru/InnoSetup_CoronaSkin_and_SystemTest.7z

Помогите пожалуйста!!!

Сори за два поста подряд, просто в один пост все скрипты не помещаются.

Serega
08-07-2009, 22:52
Raf-9600,
[Setup]
AppName=My Program
AppVerName=My Program 1.5
DefaultDirName={pf}\My Program
OutputDir=.
Compression=lzma/ultra
InternalCompressLevel=ultra
SolidCompression=yes

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

[Types]
Name: full; Description: Полная установка
Name: custom; Description: Выборочная установка; Flags: iscustom

[Components]
Name: SoundUnit; Description: Описание SoundUnit; Types: full custom
Name: inMPQ; Description: Описание inMPQ; Types: full

[Run]
Filename: {app}\del Ogg [SoundUnit].bat; StatusMsg: Удаление лишних файлов...; Components: SoundUnit; Afterinstall: Ext; Flags: runhidden

[Code]
////////////////////////////////////////////
// Данный скрипт прячет чужую программу
////////////////////////////////////////////

type
_TMsg = record
hwnd: HWND;
message: LongWord;
wParam: Longint;
lParam: Longint;
time: LongWord;
pt: TPoint;
end;

const
WM_CLOSE = $0010;
WM_QUIT = $0012;
PM_REMOVE = 1;

// отобpажает или пpячет окно обpазом, указанным паpаметpом CmdShow
function ShowWindow(hWnd: HWND; nCmdShow: Integer): BOOL; external 'ShowWindow@user32.dll stdcall';
// запускает указанный файл, с параметрами указанными в CmdShow
function WinExec(lpCmdLine: PChar; uCmdShow: Cardinal): Cardinal;
external 'WinExec@kernel32.dll stdcall';

// пpовеpяет очеpедь пpикладной задачи на сообщение и копиpует его в Msg,
// если в очеpеди нет сообщений, функция выполняет немедленный возвpат и пеpедает упpавление Windows.
function PeekMessage(var lpMsg: _TMsg; hWnd: HWND;
wMsgFilterMin, wMsgFilterMax, wRemoveMsg: UINT): BOOL; external 'PeekMessageA@user32.dll stdcall';
// пеpеводит комбинации wm_KeyDown/Up в wm_Char или wm_DeadChar и комбинации wm_SysKeyDown/Up в wm_SysChar или
// wm_SysDeadChar и напpавляет символьное сообщение в очеpедь пpикладной задачи.
function TranslateMessage(const lpMsg: _TMsg): BOOL; external 'TranslateMessage@user32.dll stdcall';
// пеpедает в Msg сообщение оконной функции окна
function DispatchMessage(const lpMsg: _TMsg): Longint; external 'DispatchMessageA@user32.dll stdcall';

var
cap_win: string;
_res: Boolean;
// сообщаем, что уже можно запускать RunProg
procedure Ext;
begin
_res:= True;
end;

procedure Application_ProcessMessages;
var
Msg: _TMsg;
begin
while PeekMessage(Msg, WizardForm.Handle, 0, 0, PM_REMOVE) do
begin
TranslateMessage(Msg);
DispatchMessage(Msg);
end;
end;

procedure RunProg(file, param, capt, mes: string; wait: Boolean);
var
Wnd: THandle;
i, ID: Integer;
begin
cap_win:= capt;
if FileExists(file) = True then // проверям наличие файла рядом с инсталлятором
begin
// показываем своё сообщение
if mes <> '' then WizardForm.StatusLabel.Caption:= mes;
// запускаем файл
ID:= WinExec(AddQuotes(file + param), SW_HIDE);
if ID > 32 then
repeat
if FindWindowByWindowName(capt) > 0 then
begin
Wnd:= FindWindowByWindowName(capt);
ShowWindow(Wnd, SW_HIDE); // прячем программу... :)
Break;
end
else Sleep(10);
i:= i+1;
until (Wnd > 0) or (i = 500) // выходим из цикла, если нашли окно или после пяти секунд
else
begin
MsgBox('Ошибка при запуске файла: ' + ExtractFileName(file), mbInformation, MB_OK);
Exit;
end;
// если надо подождать, то ждём пока программа не закроется...
if wait = True then
while FindWindowByWindowName(capt) > 0 do
Application_ProcessMessages;
WizardForm.StatusLabel.Caption:= WizardForm.StatusLabel.Caption;
end;
end;

procedure CurStepChanged(CurStep: TSetupStep);
var
n: Integer;
begin
if (CurStep = ssPostInstall) and (IsComponentSelected('inMPQ')) then
begin
n:= 0;
while _res = False do
begin
n:= n + 1;
Application_ProcessMessages;
if n = 60000 then Break;
end;
RunProg(ExpandConstant('{src}\winmpq\WinMPQ.exe'), // расположение программы
' s Sound.txt', // параметр запуска
'WinMPQ', // заголовок окна программы
'Встраивание озвучки юнитов...', // сообщение в окне мастера
True); // True - ждать завершения программы
end;
end;

Raf-9600
08-07-2009, 23:28
Serega, Хм.. Возможно конечно я где-то опечатался, но сечас, когда WinMPQ должен запуститься, светиться "Ошибка при запуске файла: WinMPQ.exe".

[Setup]
AppName=My Program
AppVerName=My Program v 1.5
DefaultDirName={pf}\My Program
OutputDir=.
Compression=zip
SolidCompression=yes

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

[Types]
Name: full; Description: Полная установка
Name: custom; Description: Выборочная установка; Flags: iscustom

[Components]
Name: SoundUnit; Description: Описание SoundUnit; Types: full custom
Name: inMPQ; Description: Описание inMPQ; Types: full


[Files]
Source: D:\Русификатор AiO\-Технические-\Ogg - Wav\libvorbis.dll; DestDir: {app}
Source: D:\Русификатор AiO\-Технические-\Ogg - Wav\libvorbisfile.dll; DestDir: {app}
Source: D:\Русификатор AiO\-Технические-\Ogg - Wav\oggdec.exe; DestDir: {app}
Source: D:\Русификатор AiO\-Технические-\Ogg - Wav\libFLAC_dynamic.dll; DestDir: {app}
Source: D:\Русификатор AiO\-Технические-\Ogg - Wav\libogg.dll; DestDir: {app}
Source: D:\Русификатор AiO\-Технические-\inMPQ\SFmpq.dll; DestDir: {app}
Source: D:\Русификатор AiO\-Технические-\inMPQ\WinMPQ.exe; DestDir: {app}

Source: D:\Русификатор AiO\SC1\Юниты\del Wav [SoundUnit].bat; DestDir: {app}
Source: D:\Русификатор AiO\SC1\Юниты\inWAV [SoundUnit].bat; DestDir: {app}
Source: D:\Русификатор AiO\SC1\Юниты\del Ogg [SoundUnit].bat; DestDir: {app}
Source: D:\Русификатор AiO\SC1\Юниты\DE\Sound.txt; DestDir: {app}
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\advisor\paderr00.ogg; DestDir: {app}\sound\protoss\advisor
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\advisor\paderr01.ogg; DestDir: {app}\sound\protoss\advisor
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\advisor\paderr02.ogg; DestDir: {app}\sound\protoss\advisor
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\advisor\paderr06.ogg; DestDir: {app}\sound\protoss\advisor
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\advisor\padupd00.ogg; DestDir: {app}\sound\protoss\advisor
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\advisor\padupd01.ogg; DestDir: {app}\sound\protoss\advisor
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\advisor\padupd02.ogg; DestDir: {app}\sound\protoss\advisor
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\advisor\padupd04.ogg; DestDir: {app}\sound\protoss\advisor
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\advisor\padupd06.ogg; DestDir: {app}\sound\protoss\advisor
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\arbiter\pabcag00.ogg; DestDir: {app}\sound\protoss\arbiter
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\arbiter\pabdth00.ogg; DestDir: {app}\sound\protoss\arbiter
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\arbiter\pabfol00.ogg; DestDir: {app}\sound\protoss\arbiter
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\arbiter\pabfol01.ogg; DestDir: {app}\sound\protoss\arbiter
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\arbiter\pabfol02.ogg; DestDir: {app}\sound\protoss\arbiter
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\arbiter\pabfol03.ogg; DestDir: {app}\sound\protoss\arbiter
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\arbiter\pabpss00.ogg; DestDir: {app}\sound\protoss\arbiter
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\arbiter\pabpss01.ogg; DestDir: {app}\sound\protoss\arbiter
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\arbiter\pabpss02.ogg; DestDir: {app}\sound\protoss\arbiter
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\arbiter\pabpss03.ogg; DestDir: {app}\sound\protoss\arbiter
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\arbiter\pabpss04.ogg; DestDir: {app}\sound\protoss\arbiter
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\arbiter\pabrdy00.ogg; DestDir: {app}\sound\protoss\arbiter
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\arbiter\pabwht00.ogg; DestDir: {app}\sound\protoss\arbiter
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\arbiter\pabwht01.ogg; DestDir: {app}\sound\protoss\arbiter
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\arbiter\pabwht02.ogg; DestDir: {app}\sound\protoss\arbiter
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\arbiter\pabwht03.ogg; DestDir: {app}\sound\protoss\arbiter
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\arbiter\pabyes00.ogg; DestDir: {app}\sound\protoss\arbiter
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\arbiter\pabyes01.ogg; DestDir: {app}\sound\protoss\arbiter
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\arbiter\pabyes02.ogg; DestDir: {app}\sound\protoss\arbiter
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\arbiter\pabyes03.ogg; DestDir: {app}\sound\protoss\arbiter
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\archon\pardth00.ogg; DestDir: {app}\sound\protoss\archon
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\archon\parmin00.ogg; DestDir: {app}\sound\protoss\archon
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\archon\parpss00.ogg; DestDir: {app}\sound\protoss\archon
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\archon\parpss01.ogg; DestDir: {app}\sound\protoss\archon
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\archon\parpss02.ogg; DestDir: {app}\sound\protoss\archon
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\archon\parpss03.ogg; DestDir: {app}\sound\protoss\archon
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\archon\parrdy00.ogg; DestDir: {app}\sound\protoss\archon
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\archon\parwht00.ogg; DestDir: {app}\sound\protoss\archon
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\archon\parwht01.ogg; DestDir: {app}\sound\protoss\archon
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\archon\parwht02.ogg; DestDir: {app}\sound\protoss\archon
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\archon\parwht03.ogg; DestDir: {app}\sound\protoss\archon
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\archon\paryes00.ogg; DestDir: {app}\sound\protoss\archon
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\archon\paryes01.ogg; DestDir: {app}\sound\protoss\archon
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\archon\paryes02.ogg; DestDir: {app}\sound\protoss\archon
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\archon\paryes03.ogg; DestDir: {app}\sound\protoss\archon
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\bldg\pacwht00.ogg; DestDir: {app}\sound\protoss\bldg
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\bldg\paswht00.ogg; DestDir: {app}\sound\protoss\bldg
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\bldg\pbaact00.ogg; DestDir: {app}\sound\protoss\bldg
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\bldg\pbawht00.ogg; DestDir: {app}\sound\protoss\bldg
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\bldg\pbewht00.ogg; DestDir: {app}\sound\protoss\bldg
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\bldg\pciwht00.ogg; DestDir: {app}\sound\protoss\bldg
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\bldg\pfowht00.ogg; DestDir: {app}\sound\protoss\bldg
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\bldg\pgawht00.ogg; DestDir: {app}\sound\protoss\bldg
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\bldg\pgcwht00.ogg; DestDir: {app}\sound\protoss\bldg
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\bldg\pnawht00.ogg; DestDir: {app}\sound\protoss\bldg
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\bldg\pnewht00.ogg; DestDir: {app}\sound\protoss\bldg
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\bldg\ppbwht00.ogg; DestDir: {app}\sound\protoss\bldg
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\bldg\ppywht00.ogg; DestDir: {app}\sound\protoss\bldg
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\bldg\prowht00.ogg; DestDir: {app}\sound\protoss\bldg
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\bldg\pstwht00.ogg; DestDir: {app}\sound\protoss\bldg
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\bldg\ptrwht00.ogg; DestDir: {app}\sound\protoss\bldg
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\bldg\pwawht00.ogg; DestDir: {app}\sound\protoss\bldg
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\carrier\pcadth00.ogg; DestDir: {app}\sound\protoss\carrier
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\carrier\pcadth01.ogg; DestDir: {app}\sound\protoss\carrier
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\carrier\pcapss00.ogg; DestDir: {app}\sound\protoss\carrier
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\carrier\pcapss01.ogg; DestDir: {app}\sound\protoss\carrier
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\carrier\pcapss02.ogg; DestDir: {app}\sound\protoss\carrier
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\carrier\pcapss03.ogg; DestDir: {app}\sound\protoss\carrier
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\carrier\pcardy00.ogg; DestDir: {app}\sound\protoss\carrier
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\carrier\pcawht00.ogg; DestDir: {app}\sound\protoss\carrier
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\carrier\pcawht01.ogg; DestDir: {app}\sound\protoss\carrier
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\carrier\pcawht02.ogg; DestDir: {app}\sound\protoss\carrier
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\carrier\pcawht03.ogg; DestDir: {app}\sound\protoss\carrier
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\carrier\pcayes00.ogg; DestDir: {app}\sound\protoss\carrier
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\carrier\pcayes01.ogg; DestDir: {app}\sound\protoss\carrier
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\carrier\pcayes02.ogg; DestDir: {app}\sound\protoss\carrier
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\carrier\pcayes03.ogg; DestDir: {app}\sound\protoss\carrier
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\darktemplar\pdtdth00.ogg; DestDir: {app}\sound\protoss\darktemplar
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\darktemplar\pdtpss00.ogg; DestDir: {app}\sound\protoss\darktemplar
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\darktemplar\pdtpss01.ogg; DestDir: {app}\sound\protoss\darktemplar
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\darktemplar\pdtpss02.ogg; DestDir: {app}\sound\protoss\darktemplar
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\darktemplar\pdtpss03.ogg; DestDir: {app}\sound\protoss\darktemplar
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\darktemplar\pdtwht00.ogg; DestDir: {app}\sound\protoss\darktemplar
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\darktemplar\pdtwht01.ogg; DestDir: {app}\sound\protoss\darktemplar
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\darktemplar\pdtwht02.ogg; DestDir: {app}\sound\protoss\darktemplar
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\darktemplar\pdtwht03.ogg; DestDir: {app}\sound\protoss\darktemplar
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\darktemplar\pdtyes00.ogg; DestDir: {app}\sound\protoss\darktemplar
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\darktemplar\pdtyes01.ogg; DestDir: {app}\sound\protoss\darktemplar
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\darktemplar\pdtyes02.ogg; DestDir: {app}\sound\protoss\darktemplar
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\darktemplar\pdtyes03.ogg; DestDir: {app}\sound\protoss\darktemplar
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\dragoon\pdrdth00.ogg; DestDir: {app}\sound\protoss\dragoon
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\dragoon\pdrpss00.ogg; DestDir: {app}\sound\protoss\dragoon
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\dragoon\pdrpss01.ogg; DestDir: {app}\sound\protoss\dragoon
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\dragoon\pdrpss02.ogg; DestDir: {app}\sound\protoss\dragoon
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\dragoon\pdrpss03.ogg; DestDir: {app}\sound\protoss\dragoon
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\dragoon\pdrrdy00.ogg; DestDir: {app}\sound\protoss\dragoon
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\dragoon\pdrwht00.ogg; DestDir: {app}\sound\protoss\dragoon
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\dragoon\pdrwht01.ogg; DestDir: {app}\sound\protoss\dragoon
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\dragoon\pdrwht02.ogg; DestDir: {app}\sound\protoss\dragoon
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\dragoon\pdrwht03.ogg; DestDir: {app}\sound\protoss\dragoon
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\dragoon\pdrwht04.ogg; DestDir: {app}\sound\protoss\dragoon
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\dragoon\pdrwht05.ogg; DestDir: {app}\sound\protoss\dragoon
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\dragoon\pdrwht06.ogg; DestDir: {app}\sound\protoss\dragoon
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\dragoon\pdrwht07.ogg; DestDir: {app}\sound\protoss\dragoon
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\dragoon\pdryes00.ogg; DestDir: {app}\sound\protoss\dragoon
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\dragoon\pdryes01.ogg; DestDir: {app}\sound\protoss\dragoon
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\dragoon\pdryes02.ogg; DestDir: {app}\sound\protoss\dragoon
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\dragoon\pdryes03.ogg; DestDir: {app}\sound\protoss\dragoon
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\dragoon\pdryes04.ogg; DestDir: {app}\sound\protoss\dragoon
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\dragoon\pdryes05.ogg; DestDir: {app}\sound\protoss\dragoon
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\dragoon\pdryes06.ogg; DestDir: {app}\sound\protoss\dragoon
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\fenixd\ufdpss00.ogg; DestDir: {app}\sound\protoss\fenixd
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\fenixd\ufdpss01.ogg; DestDir: {app}\sound\protoss\fenixd
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\fenixd\ufdpss02.ogg; DestDir: {app}\sound\protoss\fenixd
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\fenixd\ufdpss03.ogg; DestDir: {app}\sound\protoss\fenixd
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\fenixd\ufdwht00.ogg; DestDir: {app}\sound\protoss\fenixd
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\fenixd\ufdwht01.ogg; DestDir: {app}\sound\protoss\fenixd
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\fenixd\ufdwht02.ogg; DestDir: {app}\sound\protoss\fenixd
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\fenixd\ufdwht03.ogg; DestDir: {app}\sound\protoss\fenixd
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\fenixd\ufdyes00.ogg; DestDir: {app}\sound\protoss\fenixd
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\fenixd\ufdyes01.ogg; DestDir: {app}\sound\protoss\fenixd
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\fenixd\ufdyes02.ogg; DestDir: {app}\sound\protoss\fenixd
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\fenixd\ufdyes03.ogg; DestDir: {app}\sound\protoss\fenixd
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\fenixz\ufedth00.ogg; DestDir: {app}\sound\protoss\fenixz
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\fenixz\ufepss00.ogg; DestDir: {app}\sound\protoss\fenixz
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\fenixz\ufepss01.ogg; DestDir: {app}\sound\protoss\fenixz
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\fenixz\ufepss02.ogg; DestDir: {app}\sound\protoss\fenixz
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\fenixz\ufepss03.ogg; DestDir: {app}\sound\protoss\fenixz
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\fenixz\ufewht00.ogg; DestDir: {app}\sound\protoss\fenixz
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\fenixz\ufewht01.ogg; DestDir: {app}\sound\protoss\fenixz
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\fenixz\ufewht02.ogg; DestDir: {app}\sound\protoss\fenixz
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\fenixz\ufewht03.ogg; DestDir: {app}\sound\protoss\fenixz
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\fenixz\ufeyes00.ogg; DestDir: {app}\sound\protoss\fenixz
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\fenixz\ufeyes01.ogg; DestDir: {app}\sound\protoss\fenixz
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\fenixz\ufeyes02.ogg; DestDir: {app}\sound\protoss\fenixz
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\fenixz\ufeyes03.ogg; DestDir: {app}\sound\protoss\fenixz
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\gantrithor\utcpss00.ogg; DestDir: {app}\sound\protoss\gantrithor
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\gantrithor\utcpss01.ogg; DestDir: {app}\sound\protoss\gantrithor
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\gantrithor\utcpss02.ogg; DestDir: {app}\sound\protoss\gantrithor
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\gantrithor\utcpss03.ogg; DestDir: {app}\sound\protoss\gantrithor
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\gantrithor\utcwht00.ogg; DestDir: {app}\sound\protoss\gantrithor
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\gantrithor\utcwht01.ogg; DestDir: {app}\sound\protoss\gantrithor
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\gantrithor\utcwht02.ogg; DestDir: {app}\sound\protoss\gantrithor
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\gantrithor\utcwht03.ogg; DestDir: {app}\sound\protoss\gantrithor
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\gantrithor\utcyes00.ogg; DestDir: {app}\sound\protoss\gantrithor
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\gantrithor\utcyes01.ogg; DestDir: {app}\sound\protoss\gantrithor
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\gantrithor\utcyes02.ogg; DestDir: {app}\sound\protoss\gantrithor
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\gantrithor\utcyes03.ogg; DestDir: {app}\sound\protoss\gantrithor
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\intercep\pinlau00.ogg; DestDir: {app}\sound\protoss\intercep
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\probe\ppratt00.ogg; DestDir: {app}\sound\protoss\probe
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\probe\ppratt01.ogg; DestDir: {app}\sound\protoss\probe
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\probe\pprdth00.ogg; DestDir: {app}\sound\protoss\probe
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\probe\pprerr00.ogg; DestDir: {app}\sound\protoss\probe
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\probe\pprerr01.ogg; DestDir: {app}\sound\protoss\probe
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\probe\pprmin00.ogg; DestDir: {app}\sound\protoss\probe
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\probe\pprpss00.ogg; DestDir: {app}\sound\protoss\probe
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\probe\pprpss01.ogg; DestDir: {app}\sound\protoss\probe
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\probe\pprpss02.ogg; DestDir: {app}\sound\protoss\probe
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\probe\pprpss03.ogg; DestDir: {app}\sound\protoss\probe
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\probe\pprrdy00.ogg; DestDir: {app}\sound\protoss\probe
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\probe\pprwht00.ogg; DestDir: {app}\sound\protoss\probe
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\probe\pprwht01.ogg; DestDir: {app}\sound\protoss\probe
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\probe\pprwht02.ogg; DestDir: {app}\sound\protoss\probe
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\probe\pprwht03.ogg; DestDir: {app}\sound\protoss\probe
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\probe\ppryes00.ogg; DestDir: {app}\sound\protoss\probe
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\probe\ppryes01.ogg; DestDir: {app}\sound\protoss\probe
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\probe\ppryes02.ogg; DestDir: {app}\sound\protoss\probe
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\probe\ppryes03.ogg; DestDir: {app}\sound\protoss\probe
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\scout\pscdth00.ogg; DestDir: {app}\sound\protoss\scout
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\scout\pscpss00.ogg; DestDir: {app}\sound\protoss\scout
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\scout\pscpss01.ogg; DestDir: {app}\sound\protoss\scout
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\scout\pscpss02.ogg; DestDir: {app}\sound\protoss\scout
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\scout\pscpss03.ogg; DestDir: {app}\sound\protoss\scout
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\scout\pscpss04.ogg; DestDir: {app}\sound\protoss\scout
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\scout\pscrdy00.ogg; DestDir: {app}\sound\protoss\scout
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\scout\pscwht00.ogg; DestDir: {app}\sound\protoss\scout
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\scout\pscwht01.ogg; DestDir: {app}\sound\protoss\scout
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\scout\pscwht02.ogg; DestDir: {app}\sound\protoss\scout
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\scout\pscwht03.ogg; DestDir: {app}\sound\protoss\scout
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\scout\pscyes00.ogg; DestDir: {app}\sound\protoss\scout
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\scout\pscyes01.ogg; DestDir: {app}\sound\protoss\scout
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\scout\pscyes02.ogg; DestDir: {app}\sound\protoss\scout
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\scout\pscyes03.ogg; DestDir: {app}\sound\protoss\scout
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\shuttle\pshbld00.ogg; DestDir: {app}\sound\protoss\shuttle
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\shuttle\pshbld01.ogg; DestDir: {app}\sound\protoss\shuttle
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\shuttle\pshbld02.ogg; DestDir: {app}\sound\protoss\shuttle
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\shuttle\pshbld03.ogg; DestDir: {app}\sound\protoss\shuttle
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\shuttle\pshbld04.ogg; DestDir: {app}\sound\protoss\shuttle
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\shuttle\pshdth00.ogg; DestDir: {app}\sound\protoss\shuttle
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\shuttle\pshpss00.ogg; DestDir: {app}\sound\protoss\shuttle
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\shuttle\pshpss01.ogg; DestDir: {app}\sound\protoss\shuttle
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\shuttle\pshpss02.ogg; DestDir: {app}\sound\protoss\shuttle
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\shuttle\pshpss03.ogg; DestDir: {app}\sound\protoss\shuttle
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\shuttle\pshpss04.ogg; DestDir: {app}\sound\protoss\shuttle
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\shuttle\pshrdy00.ogg; DestDir: {app}\sound\protoss\shuttle
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\shuttle\pshwht00.ogg; DestDir: {app}\sound\protoss\shuttle
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\shuttle\pshwht01.ogg; DestDir: {app}\sound\protoss\shuttle
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\shuttle\pshwht02.ogg; DestDir: {app}\sound\protoss\shuttle
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\shuttle\pshwht03.ogg; DestDir: {app}\sound\protoss\shuttle
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\shuttle\pshyes00.ogg; DestDir: {app}\sound\protoss\shuttle
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\shuttle\pshyes01.ogg; DestDir: {app}\sound\protoss\shuttle
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\shuttle\pshyes02.ogg; DestDir: {app}\sound\protoss\shuttle
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\shuttle\pshyes03.ogg; DestDir: {app}\sound\protoss\shuttle
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\tassadar\utadth00.ogg; DestDir: {app}\sound\protoss\tassadar
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\tassadar\utapss00.ogg; DestDir: {app}\sound\protoss\tassadar
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\tassadar\utapss01.ogg; DestDir: {app}\sound\protoss\tassadar
Source: D:\Русификатор AiO\SC1\Юниты\DE\sound\protoss\tassadar\utapss02.ogg; DestDir: {app}\sound\protoss\tassadar



[Run]
Filename: {app}\inWAV [SoundUnit].bat; StatusMsg: inWAV [SoundUnit]...; Components: SoundUnit; Flags: runhidden
Filename: {app}\del Ogg [SoundUnit].bat; StatusMsg: Удаление лишних файлов...; Components: SoundUnit; Afterinstall: Ext; Flags: runhidden
Filename: {app}\del Wav [SoundUnit].bat; StatusMsg: del Wav [SoundUnit]...; Components: SoundUnit; Flags: runhidden



[code]
////////////////////////////////////////////
// Данный скрипт прячет чужую программу
////////////////////////////////////////////

type
_TMsg = record
hwnd: HWND;
message: LongWord;
wParam: Longint;
lParam: Longint;
time: LongWord;
pt: TPoint;
end;

const
WM_CLOSE = $0010;
WM_QUIT = $0012;
PM_REMOVE = 1;

// отобpажает или пpячет окно обpазом, указанным паpаметpом CmdShow
function ShowWindow(hWnd: HWND; nCmdShow: Integer): BOOL; external 'ShowWindow@user32.dll stdcall';
// запускает указанный файл, с параметрами указанными в CmdShow
function WinExec(lpCmdLine: PChar; uCmdShow: Cardinal): Cardinal;
external 'WinExec@kernel32.dll stdcall';

// пpовеpяет очеpедь пpикладной задачи на сообщение и копиpует его в Msg,
// если в очеpеди нет сообщений, функция выполняет немедленный возвpат и пеpедает упpавление Windows.
function PeekMessage(var lpMsg: _TMsg; hWnd: HWND;
wMsgFilterMin, wMsgFilterMax, wRemoveMsg: UINT): BOOL; external 'PeekMessageA@user32.dll stdcall';
// пеpеводит комбинации wm_KeyDown/Up в wm_Char или wm_DeadChar и комбинации wm_SysKeyDown/Up в wm_SysChar или
// wm_SysDeadChar и напpавляет символьное сообщение в очеpедь пpикладной задачи.
function TranslateMessage(const lpMsg: _TMsg): BOOL; external 'TranslateMessage@user32.dll stdcall';
// пеpедает в Msg сообщение оконной функции окна
function DispatchMessage(const lpMsg: _TMsg): Longint; external 'DispatchMessageA@user32.dll stdcall';

var
cap_win: string;
_res: Boolean;
// сообщаем, что уже можно запускать RunProg
procedure Ext;
begin
_res:= True;
end;

procedure Application_ProcessMessages;
var
Msg: _TMsg;
begin
while PeekMessage(Msg, WizardForm.Handle, 0, 0, PM_REMOVE) do
begin
TranslateMessage(Msg);
DispatchMessage(Msg);
end;
end;

procedure RunProg(file, param, capt, mes: string; wait: Boolean);
var
Wnd: THandle;
i, ID: Integer;
begin
cap_win:= capt;
if FileExists(file) = True then // проверям наличие файла рядом с инсталлятором
begin
// показываем своё сообщение
if mes <> '' then WizardForm.StatusLabel.Caption:= mes;
// запускаем файл
ID:= WinExec(AddQuotes(file + param), SW_HIDE);
if ID > 32 then
repeat
if FindWindowByWindowName(capt) > 0 then
begin
Wnd:= FindWindowByWindowName(capt);
ShowWindow(Wnd, SW_HIDE); // прячем программу... :)
Break;
end
else Sleep(10);
i:= i+1;
until (Wnd > 0) or (i = 500) // выходим из цикла, если нашли окно или после пяти секунд
else
begin
MsgBox('Ошибка при запуске файла: ' + ExtractFileName(file), mbInformation, MB_OK);
Exit;
end;
// если надо подождать, то ждём пока программа не закроется...
if wait = True then
while FindWindowByWindowName(capt) > 0 do
Application_ProcessMessages;
WizardForm.StatusLabel.Caption:= WizardForm.StatusLabel.Caption;
end;
end;

procedure CurStepChanged(CurStep: TSetupStep);
var
n: Integer;
begin
if (CurStep = ssPostInstall) and (IsComponentSelected('inMPQ')) then
begin
n:= 0;
while _res = False do
begin
n:= n + 1;
Application_ProcessMessages;
if n = 60000 then Break;
end;
RunProg(ExpandConstant('{app}\WinMPQ.exe'), // расположение программы
' s Sound.txt', // параметр запуска
'WinMPQ', // заголовок окна программы
'Встраивание озвучки юнитов...', // сообщение в окне мастера
True); // True - ждать завершения программы
end;
end;

Serega
09-07-2009, 00:02
Возможно конечно я где-то опечатался, но сечас, когда WinMPQ должен запуститься »
Проверьте параметры запуска WinMPQ, в процедуре CurStepChanged.
Параметр запуска - 's Sound.txt', а файл Sound.txt я не увидел в вашем скрипте.

Raf-9600
09-07-2009, 14:00
файл Sound.txt я не увидел в вашем скрипте »
Вот он Source: D:\Русификатор AiO\SC1\Юниты\DE\Sound.txt; DestDir: {app}

Колдовал как мог, с моей стороны ошибки вроде нет. И кстати, заметил одну странность, если параметр запуска оставить пустым, то WinMPQ после запуска, выдает ошибку "No files are selected.", хотя если его просто запустить, он ничего подобного "говорить" не должен. Его окно, кстати, полностью скрыто (кроме окна ошибки). Но заметил один нюанс, в то время как процесс WinMPQ ещё не закрыт, процесс Setup.tmp отбирает почти 30% процессорного времени, хотя он видь никаких действий в этот момент выполнять не может.




© OSzone.net 2001-2012