18
Có thể chạy tệp bằng Inno Setup, trước khi bắt đầu thiết lập không? DocumentationLàm thế nào để chạy một tệp trước khi thiết lập với Inno Setup
Có thể chạy tệp bằng Inno Setup, trước khi bắt đầu thiết lập không? DocumentationLàm thế nào để chạy một tệp trước khi thiết lập với Inno Setup
Vâng. Trong phần [code]
chạy tệp trong hàm InitializeSetup()
. Ví dụ này khởi chạy notepad trước khi thiết lập chạy.
function InitializeSetup(): boolean;
var
ResultCode: integer;
begin
// Launch Notepad and wait for it to terminate
if Exec(ExpandConstant('{win}\notepad.exe'), '', '', SW_SHOW,
ewWaitUntilTerminated, ResultCode) then
begin
// handle success if necessary; ResultCode contains the exit code
end
else begin
// handle failure if necessary; ResultCode contains the error code
end;
// Proceed Setup
Result := True;
end;
Đây là những gì tôi cần! Cảm ơn. –
Điều này không nên được thực hiện trong InitializeSetup nếu nó thay đổi bất cứ điều gì trên máy tính người dùng. Điều này nên được thực hiện sau khi người dùng đã nhấn "Cài đặt", tức là PrepareToInstall() hoặc CurStepChanged (ssInstall). – Deanna