[code]
;
; ,:/+/-
; /M/ .,-=;//;-
; .:/= ;MH/, ,=/+%$XH@MM#@:
; -$##@+$###@H@MMM#######H:. -/H#
; .,H@H@ X######@ -H#####@+- -+H###@X
; .,@##H; +XM##M/, =%@###@X;-
; X%- :M##########$. .:%M###@%:
; M##H, +H@@@$/-. ,;$M###@%, -
; M####M=,,---,.-%%H####M$: ,+@##
; @##################@/. :%H##@$-
; M###############H, ;HM##M$=
; #################. .=$M##M$=
; ################H..;XM##M$= .:+
; M###################@%= =+@MH%
; @################M/. =+H#X%=
; =+M##############M, -/X#X+;.
; .;XM##########H= ,/X#H+:,
; .=+HM######M+/+HM@+=.
; ,:/%XM####H/.
; ,.:=-.
;
; Creator: Shepa & VoLT
#define MyAppName "My Program"
#define MyAppVerName "My Program 1.5"
#define MyAppPublisher "My Company, Inc."
#define MyAppURL "http://www.example.com/"
#define MyAppExeName "MyProg.exe"
[Setup]
AppName={#MyAppName}
AppVerName={#MyAppVerName}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
A ppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputBaseFilename=setup
Compression=lzma
Solid Compression=yes
[Languages]
Name: "default"; MessagesFile: "compiler:Default.isl"
[Files]
Source: "mix.exe"; Flags: dontcopy
Source: "radutil.dll"; Flags: dontcopy
Source: "binkmake.dll"; Flags: dontcopy
Source: "isexec.dll"; Flags: dontcopy
[UninstallDelete]
Type: filesandordirs; Name: {app};
[code]
var
Cancel:integer;
isexec_cancel: boolean;
procedure InitializeWizard();
begin
isexec_cancel := True;
end;
type
TISCreateProcessCallback = function(): boolean;
function CreateProcess(callback: TISCreateProcessCallback; EXEName: PAnsiChar; DIRName: PAnsiChar; Show: boolean; Comfort: boolean; hWnd: HWND): BOOL; external 'isexec_cp@files:isexec.dll stdcall';
function ISCreateProcessCallback(): boolean;
begin
Result := isexec_cancel; // вернёш False прервеш запуск
begin
if not(isexec_cancel) then
begin
DelTree(ExpandConstant('{app}'), True, True, True); /// удаление временных файлов при отмене (если файл занят то он останется)
end;
end;
end;
procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
Confirm:=False;
Cancel:=True;
if CurPageID = wpInstalling then
begin
isexec_cancel := false;
end;
end;
// способ 1
//|
//|
//v
procedure bink_mix (trak, bik, wav, new_bik, WorkDir_bik: string);
begin
if not(CreateProcess(@ISCreateProcessCallback, ExpandConstant('{tmp}\mix.exe')+ ' ' +trak +AddQuotes(ExpandConstant(bik))+ ' ' +AddQuotes(ExpandConstant(wav))+' '+AddQuotes(ExpandConstant(new_bik)), ExpandConstant(WorkDir_bik), True, FALSE, WizardForm.Handle)) then exit;
DeleteFile(ExpandConstant(wav));
end;
// ыть 1
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssInstall then // выгрузка
begin
ExtractTemporaryFile('mix.exe');
ExtractTemporaryFile('radutil.dll');
ExtractTemporaryFile('binkmake.dll');
end;
if CurStep = sspostInstall then // сборка
begin
// способ 1
//|
//|
//v
(* трек куда клеить входной bik входной wav выходной bik рабочая папка
| | | | |
v v v v v *)
bink_mix ('/o /l4 /t9 /#', '{app}\1\PC_sc01a.bik', '{app}\1\PC_sc01a.wav', '{app}\1\PC_sc01a.bik', '{app}\1');
// ыть 1
//способ 2
//|
//|
//v
//if not(CreateProcess(@ISCreateProcessCallback,ExpandConstant('{tmp}\mix.exe') + ' ' + ' PC_sc01a.bik PC_sc01a.wav PC_sc01a.bik /o /l4 /t3 /# ' ,(ExpandConstant('{app}\1')), True, FALSE, WizardForm.Handle)) then exit;
//DeleteFile(ExpandConstant('{app}\1\PC_sc01a.wav'));
// ыть 2
end;
end;
[code]