从安装程序写入AppData部署项目
我正在更新通过安装和部署项目安装的现有应用程序。
旧应用程序在安装过程中将配置和数据库文件复制到 Program Files 中的应用程序文件夹中。这在 Win 2000 和 Win Xp 上运行良好(在本地管理员帐户下)。然而,在 Windows 7 中,这不仅不受欢迎,而且由于 UAC 的原因它基本上不起作用。
所以我想更新应用程序以将其配置/数据写入 CommonApplicationData 中。在现有的安装和部署项目中,您可以轻松选择某些位置作为复制文件的目标。即应用程序文件夹、用户桌面、&用户的程序文件。
我没有看到告诉安装程序复制到 AppData / CommonApplicationData 文件夹的类似方法。这种情况是否存在,如果不存在,是否有任何简单的修复方法?
谢谢!
I am updating an existing application that is installed via a Setup and Deployment Project.
The old application copied a config and a database file into the application's folder in Program Files during installation. This worked fine on Win 2000 and Win Xp (under a local admin account). In Windows 7, however, not only is this frowned upon, but it essentially doesn't work due to UAC.
So I want to update the application to write its config/data in CommonApplicationData. In the existing Setup and Deployment project, you can easily select some locations as targets for copying files. i.e. Application Folder, User's Desktop, & User's Program Files.
I do not see an analogous means of telling the Setup program to copy to the AppData / CommonApplicationData folders. Does that exist, and if not, are there any simple fixes?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
右键单击 |添加特殊文件夹 |自定义文件夹并将其命名为您想要的任何名称(公共应用程序数据文件夹会很好)
在文件夹属性网格中,将 DefaultLocation 属性更改为 [CommonAppDataFolder]。
将文件添加到文件夹中,构建并安装。在 Windows 7 上,您应该在 C:\ProgramData 中找到您的文件。
请注意,我强烈推荐其他工具,例如 InstallShield 和 WiX,而不是 Visual Studio 部署项目。该工具的功能非常有限,您最终会碰壁。
Do a Right Click | Add Special Folder | Custom Folder and name it anything you want ( Common Application Data Folder would be good )
In the folder properties grid, change the DefaultLocation attribute to [CommonAppDataFolder].
Add a file to the folder, build and install. You should find your file in C:\ProgramData on Windows 7.
Be advised, I highly reccomend other tools such as InstallShield and WiX over Visual Studio Deployment Projects. The tool is very limited in what it can do and you will eventually hit a brick wall.