从设置和放大器写入应用程序数据;部署项目 [英] Writing to AppData from a Setup & Deployment Project

查看:146
本文介绍了从设置和放大器写入应用程序数据;部署项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我更新,这是通过安装和部署项目安装在现有的应用程序。

旧的应用程序复制了配置和数据库文件到Program Files中应用程序的文件夹在安装过程中。这工作正常在Win 2000和Win XP(在本地管理员帐户)。在Windows 7中,然而,这不仅是令人难以接受的,但它基本上不因UAC工作。

所以,我想要更新的应用程序写入其配置/数据CommonApplicationData。在现有的安装和部署项目,您可以轻松地选择复制文件的某些地方为目标。即应用程序文件夹,用户的桌面,和放大器;用户的程序文件。

我看不出告诉安装程序复制到应用程序数据/ CommonApplicationData文件夹类似的手段。这是否存在,如果没有,有没有什么简单的修正?

谢谢!

解决方案

请右击|添加特殊文件夹|自定义文件夹并将其命名为任何你想要的(通用应用程序数据文件夹将是一件好事)

在文件夹属性网格,改变DefaultLocation属性[COMMONAPPDATAFOLDER]。

添加文件到文件夹,构建和安装。你应该找到在C中的文件:在Windows 7 \ ProgramData

被告知,我强烈reccomend其他工具,如InstallShield和维克斯在Visual Studio中部署项目。该工具非常有限,什么可以做,你最终会撞到南墙。

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!

解决方案

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.

这篇关于从设置和放大器写入应用程序数据;部署项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆