0

其中inno setup compiler有以下地区:

[Setup]
DefaultDirName={pf}\cow1


function NextButtonClick(CurPageID: Integer): Boolean;
var
  ExecInfo: TShellExecuteInfo;
begin
  Result := True;

  if CurPageID = wpFinished then
  begin
    ExecInfo.cbSize := SizeOf(ExecInfo);
    ExecInfo.fMask := SEE_MASK_NOCLOSEPROCESS;
    ExecInfo.Wnd := 0;
    ExecInfo.lpFile := DefaultDirName + '\{#Exewampmanager}';
    ExecInfo.nShow := SW_HIDE;

    if ShellExecuteEx(ExecInfo) then
    begin
      if WaitForSingleObject(ExecInfo.hProcess, 3000) = WAIT_TIMEOUT then
      begin
        TerminateProcess(ExecInfo.hProcess, 666);
        MsgBox('You just killed a little kitty!', mbError, MB_OK);
      end
      else
        MsgBox('The process was terminated in time!', mbInformation, MB_OK);
    end;
  end;
end;

如何在函数中使用DefaultDirName[Setup] 区域中的 const?

ps:

ExecInfo.lpFile := DefaultDirName + '\{#Exewampmanager}';不工作

4

1 回答 1

0

您必须扩展常量,例如:

ExpandConstant('{app}\myapp.exe')

{app}最终目标文件夹在哪里

于 2013-10-11T08:25:53.367 回答