Inno Setup Compiler: How to auto start the default browser with given url?不是我想要的。当我想要setup.exe
时,Inno Setup中的代码/代码如果关闭/完成/卸载,它将转到某个站点。
答案 0 :(得分:1)
要从Pascal脚本打开Web浏览器,请使用以下函数:
procedure OpenBrowser(Url: string);
var
ErrorCode: Integer;
begin
ShellExec('open', Url, '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;
要触发它,当安装程序关闭时,您可以使用CurStepChanged(ssDone)
event:
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssDone then
begin
OpenBrowser('https://www.example.com/');
end;
end;
对于卸载程序,请使用CurUninstallStepChanged(usDone)
event:
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
if CurUninstallStep = usDone then
begin
OpenBrowser('https://www.example.com/');
end;
end;