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 に答える