Avoid restart prompt in Inno Setup

 ̄綄美尐妖づ 提交于 2021-02-08 10:20:17

问题


I am using restartreplace flag to replace the locked file, so it will prompt a message at the end of the installation to restart the machine. But I don't want to display it, and it should be set to restart later by default. Is there any way?


回答1:


You can hide Yes/No restart radio buttons. And update the screen text accordingly.

procedure CurPageChanged(CurPageID: Integer);
var
  S: string;
begin
  if CurPageID = wpFinished then
  begin
    WizardForm.YesRadio.Visible := False;
    WizardForm.NoRadio.Visible := False;
    WizardForm.NoRadio.Checked := True;
    S := SetupMessage(msgFinishedLabelNoIcons);
    StringChangeEx(S, '[name]', 'My Program', True);
    WizardForm.FinishedLabel.Caption := S;
    WizardForm.AdjustLabelHeight(WizardForm.FinishedLabel);
  end; 
end;


来源:https://stackoverflow.com/questions/63424813/avoid-restart-prompt-in-inno-setup

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!