如何在 Inno Setup 的完成页面上有一个自述文件的复选框

How to have a checkbox for readmefile at the finished page in InnoSetup

我想在 InnoSetup 的结束页面有一个复选框来打开或不打开自述文件。我尝试了这样的事情(就像这里解释的那样 flag postinstall 但它似乎不起作用:

Name: "StartAfterInstall"; Description: Display the PDF Readme File; Languages: english
Filename: "{app}\readme.pdf"; Tasks: StartAfterInstall; Flags: shellexec postinstall runasoriginaluser; Languages: not French

建议只启动程序。有没有办法在不使用 Inno Setup 中的 [code] 部分的情况下做到这一点?

对于此任务,只需在 [Files] section with the isreadme 标志中标记您的自述文件条目,然后让 Inno Setup 为您完成剩下的工作:

[Files]
Source: "Readme.txt"; DestDir: "{app}"; Flags: isreadme

isreadme 标志被描述为(由我强调):

File is the "README" file. Only one file in an installation can have this flag. When a file has this flag, the user will asked if he/she would like to view the README file after the installation has completed. If Yes is chosen, Setup will open the file, using the default program for the file type. For this reason, the README file should always end with an extension like .txt, .wri, or .doc.

Note that if Setup has to restart the user's computer (as a result of installing a file with the flag restartreplace or if the AlwaysRestart [Setup] section directive is yes), the user will not be given an option to view the README file.