Under Windows Vista (2008 and Seven), an application cannot write in Program Files Folder. I understand that UAC is the responsible, but it prevents my application to self-update. Is there a folder somewhere (available in Windows XP, Vista (and all other version)) which would allow me to deploy my application and let it self-update without having to make it "elevated"?
在Windows Vista(2008和Seven)下,应用程序无法在Program Files文件夹中写入。我知道UAC是负责任的,但它阻止我的应用程序自我更新。是否有某个文件夹(在Windows XP,Vista(和所有其他版本)中可用),这将允许我部署我的应用程序并让它自我更新而不必使其“升级”?
I thought of ClickOnce, but I can't use since I don't want to pay for the expensive certificate (sign the code, installer, etc.).
我想到了ClickOnce,但我无法使用,因为我不想支付昂贵的证书(签署代码,安装程序等)。
Thanks!
2 个解决方案
#1
I personally abhor this idea but several apps have gone down this route: Instead of installing your application into the Program Files directory, install into the AppData directory.
我个人厌恶这个想法,但是有几个应用程序走了这条路:不是将应用程序安装到Program Files目录中,而是安装到AppData目录中。
I first saw this with Microsoft's SyncToy PowerToy, and then with the set of patches for World of Warcraft before the Wrath of the Lich King release. Most recently, I've seen Google Chrome also install into the AppData directory.
我首先用微软的SyncToy PowerToy看到了这个,然后在巫妖王之怒发布之前看了魔兽世界的补丁。最近,我看到谷歌浏览器也安装到AppData目录中。
The reason why I hate this idea is that for the small convenience of not getting a prompt for installation or patching, I now have the potential risk of malware quietly modifying and the binaries for the apps installed into AppData.
我讨厌这个想法的原因是,为了不方便安装或修补,我现在有潜在的恶意软件安静修改风险和安装到AppData中的应用程序的二进制文件。
#2
You should probably ask permission before updating the application anyway. Trying to write to C:\Program Files
is inherently a risky operation that the user should authorize. So I would just tell the user what you're doing, and let her allow the updater to do its job.
无论如何,您应该在更新应用程序之前获得许可。尝试写入C:\ Program Files本身就是一个用户应该授权的危险操作。所以我只是告诉用户你正在做什么,让她允许更新者完成它的工作。
#1
I personally abhor this idea but several apps have gone down this route: Instead of installing your application into the Program Files directory, install into the AppData directory.
我个人厌恶这个想法,但是有几个应用程序走了这条路:不是将应用程序安装到Program Files目录中,而是安装到AppData目录中。
I first saw this with Microsoft's SyncToy PowerToy, and then with the set of patches for World of Warcraft before the Wrath of the Lich King release. Most recently, I've seen Google Chrome also install into the AppData directory.
我首先用微软的SyncToy PowerToy看到了这个,然后在巫妖王之怒发布之前看了魔兽世界的补丁。最近,我看到谷歌浏览器也安装到AppData目录中。
The reason why I hate this idea is that for the small convenience of not getting a prompt for installation or patching, I now have the potential risk of malware quietly modifying and the binaries for the apps installed into AppData.
我讨厌这个想法的原因是,为了不方便安装或修补,我现在有潜在的恶意软件安静修改风险和安装到AppData中的应用程序的二进制文件。
#2
You should probably ask permission before updating the application anyway. Trying to write to C:\Program Files
is inherently a risky operation that the user should authorize. So I would just tell the user what you're doing, and let her allow the updater to do its job.
无论如何,您应该在更新应用程序之前获得许可。尝试写入C:\ Program Files本身就是一个用户应该授权的危险操作。所以我只是告诉用户你正在做什么,让她允许更新者完成它的工作。