首页 > 解决方案 > Inno setup 无法在 Windows 10 中创建桌面图标

问题描述

我有用于最新版本的 inno 设置的设置文件。它从 windows xp 到 windows 8 都可以编译并运行良好,但在 windows 10 中,它在创建桌面图标时失败,并出现下一个错误:IPersistFile::Save failed; 代码 0x80070002

这就是我在安装文件中创建图标的方式:

[Icons]
Name: "{userdesktop}\Forex Tester 4"; Filename: "{app}\ForexTester4.exe"; Tasks: desktopicon

部分安装日志文件:

2019-02-01 12:50:46.376   -- Icon entry --
2019-02-01 12:50:46.376   Dest filename: C:\Users\Mike\Desktop\Forex Tester 4.lnk
2019-02-01 12:50:46.376   Creating the icon.
2019-02-01 12:50:46.376   Exception message:
2019-02-01 12:50:46.376   Message box (OK):
                          IPersistFile::Save failed; code 0x80070002.
                          The system cannot find the file specified.
2019-02-01 12:50:59.066   User chose OK.

该文件夹存在,我可以在那里手动创建文件。但是 inno setup 无法做到这一点......除了桌面图标之外的所有其他图标都没有问题。

有任何想法吗?

标签: windows-10inno-setup

解决方案


它可能是一个相对较新的(自 1709 版以来)Windows 10 功能,称为受控文件夹访问。有关打开或关闭它的说明,请参阅在 Windows 安全中心中允许被阻止的应用程序。


推荐阅读