我的程序应该安装到注册表中记录的路径。如果找不到注册表项,则安装到另一个(默认)路径。
例如,我想要类似的东西:
<Property Id="MYINSTALLDIR">
<RegistrySearch Id='MyRegistry' Type='raw' Root='HKCU' Key='Software\MyApp\Foo' Name='InstallDir' />
if not found, then set "MYINSTALLDIR" to "D:\working\defaultApps"
</Property>
我应该如何编写我的 wxs 文件来实现这一点?
编辑:
现在的问题是:
if not found in registry, then set "MYINSTALLDIR" to LocalAppDataFolder
我试过了
<Property Id="MYINSTALLDIR" Value="LocalAppDataFolder">
<RegistrySearch Id='MyRegistry' Type='raw' Root='HKCU' Key='Software\MyApp\Foo' Name='InstallDir' />
</Property>
但错误返回:
Error 1606. Could not access network location LocalAppDataFolder.