简体   繁体   中英

Visual Studio 2010 setup project issue

I have found strange issue during execution of installatio file made by VS 2010. The installer should copy some files into App Data of current user. When I run installer on account with admin privileges, everything is ok. Problem appears while installing on guest account. For example I try to install app on guset account A. I must select run as option. I choose user B with admin privileges. After installation all files are copied into folder App Data of user B, not A as I expected... why? Is there any solution for this?

It is called deployment project and it is outdated and broken technology - I suggest using WIX. Those stupid proejcts should hnever have been in Visual Studio - they dont even adhere to the basics how MSI files should work.

One thing you can not nicely control is the elevation request needed for activating admin priviledges. WIX allows you full control over the MSI features.

I must select run as option. I choose user B with admin privileges. After installation all files are copied into folder App Data of user B, not A as I expected... why?

Ah - logic? You install AS USER B - so surely the files go into User b's folder.

in general you need admin priviledges to install softawre. A gues can not do it. Point. Installation is a tricky high priviledge thing, not something for someone who has no rights on the computer.

The installer should copy some files into App Data of current user.

Invalid per definition. Point. A normal install run should not install anything into a user's app data - what is another user runs the software? The software can make copies when it starts (from shared app data), but a NORMAL install (not a per user install) should never put stuff into the users personal AppData folder. This is a violation of basic MSI principles.

Symantec has a good documentation on the only valid way to do that (and sorry, setup proejcts just dont support advanced features for MSI:

http://www.symantec.com/business/support/index?page=content&id=HOWTO4840

As it reads:

In order to install files to each user's profile, a self-repair of the application must occur.

WIX has similar answers in a post:

http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/installing-files-to-user-s-application-data-folder-td5377311.html

I assume you don'd oa per user install ;)

I also assume you don't set the registry key according to ICE38 (setup warning):

http://msdn.microsoft.com/en-us/library/aa368961%28VS.85%29.aspx

In general: DO NOT DO IT. User AppData can / should happen when the user starts the app.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM