【发布时间】:2011-02-23 17:31:41
【问题描述】:
我正在尝试将我的应用程序路径添加为使用 Inno Setup 进行 MS Access 安装的受信任位置。我的脚本中有以下几行:
[Registry]
; Add the application folder as a trusted location for Access 2007
Root: HKCU; SubKey: Software\Microsoft\Office\12.0\Access\Security\Trusted Locations\{#DirName}; ValueType: string; ValueName: Path; ValueData: {app}; Check: AccessVersion('2007');
Root: HKCU; SubKey: Software\Microsoft\Office\12.0\Access\Security\Trusted Locations\{#DirName}; ValueType: string; ValueName: Description; ValueData: Grandjean and Braverman applications; Check: AccessVersion('2007');
Root: HKCU; SubKey: Software\Microsoft\Office\12.0\Access\Security\Trusted Locations\{#DirName}; ValueType: dword; ValueName: AllowSubfolders; ValueData: 1; Check: AccessVersion('2007');
这在 Windows XP 和更早版本中运行良好,但在 Vista/Win7 中的用户帐户控制下通常会失败,因为运行安装的(提升的)用户可能与当前登录的用户不同。
我能想到的唯一解决方法是通过ShellExecAsOriginalUser 提取并运行一个 .reg 文件,但这似乎很老套。有没有更好的办法?
理想情况下,我希望为系统上的所有用户添加受信任的位置。
【问题讨论】: