Inno setup Inno安装编译器:如何在事件方法中使用安装区域中的常量

Inno setup Inno安装编译器:如何在事件方法中使用安装区域中的常量,inno-setup,Inno Setup,在inno setup编译器中,有如下区域: [Setup] DefaultDirName={pf}\cow1 function NextButtonClick(CurPageID: Integer): Boolean; var ExecInfo: TShellExecuteInfo; begin Result := True; if CurPageID = wpFinished then begin ExecInfo.cbSize := SizeOf(ExecIn

在inno setup编译器中,有如下区域:

[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;
如何在函数中使用[Setup]区域中的
DefaultDirName
const

附言:


ExecInfo.lpFile:=DefaultDirName+'\{{Exewampmanager}'不起作用

必须展开常数,如:

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

其中,
{app}
是最终的目标文件夹

ExpandConstant({app}')+{{Exewampmanager}}
-在脚本中
DefaultDirName
变为
{app}
常量。您可以如上所述使用它应该可以正常工作。OT:如果wamp在3秒后没有终止,你会在3秒后杀死它。你知道的,对吧?请不要用“windows installer”标记inno安装问题。这两种技术是不相关的。