feat(Inno Setup) 添加.NET Framework 4.7.2安装检查
在安装脚本中添加初始化检查,确保系统已安装.NET Framework 4.7.2或兼容版本。如果未安装,则显示错误提示信息。 Signed-off-by: doudou0720 <98651603+doudou0720@users.noreply.github.com>
This commit is contained in:
@@ -59,5 +59,13 @@ Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
|
|||||||
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
|
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
|
||||||
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
|
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
|
||||||
|
|
||||||
|
[Code]
|
||||||
|
function InitializeSetup: Boolean;
|
||||||
|
begin
|
||||||
|
Result := True; // Always allow setup to continue
|
||||||
|
if not IsDotNetInstalled(net472, 0) then // Check if .NET Framework version 4.7.2 or compatible is installed
|
||||||
|
SuppressibleMsgBox('警告:未检测到 .NET Framework 4.7.2 或更高版本。应用程序可能无法正常运行。', mbWarning, MB_OK, IDOK);
|
||||||
|
end;
|
||||||
|
|
||||||
[Run]
|
[Run]
|
||||||
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
|
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
|
||||||
Reference in New Issue
Block a user