简体   繁体   中英

Install shortcut from VS.NET MSI installer project for ALL USERS

I've searched and searched on here. I've tried the following methods with no luck:

Set the project installer properites to - InstallforAllUsers (can't remember the exact name) but that does add the shortcut to all the user's menus, but only the user that installed the application is able to run it. The other users get a SysWOW64 error about not being able to install it or something.

Set the [DesktopFolder] or [AllUserStartMenu] again, I may not have these property names right, but I followed them from a few users that have posted on here. Giving these properties the value of ALLUSERS. The installer fails during install and says "Unable to locate network location 1" or something like that.

Used ORCA to edit the MSI file and add a property to install for all users, and failed inside ORCA with the error of unable to add property.

It's maddening. I'm using Visual Studio 2010. I think I'm just pushing the limits of the instller.. imagine that. My install is a desktop application (winforms) that has a custom installer action and class that writes some values to a setting file on choices the user makes during the install (custom UI installer screen).

Any ideas?

MSDN Site that explains how to do this MSI Install All Users

The InstallAllUsers property for a deployment project determines whether an application is installed for all users of a computer or only for the user performing the installation. The InstallAllUsers property can be set in the Properties window when a deployment project is selected in the Solution Explorer.

Settings

False - The application will only be installed for the current user and will not be visible to other users of the computer (the default).

True - The application will be installed for all users.

InstallAllUsersVisible Property

The InstallAllUsersVisible property for the Installation Folder user interface dialog box determines whether the Install MyApplication for yourself, or for anyone who uses this computer label and corresponding Everyone and Just me option buttons appear during installation. The InstallAllUsersVisible can be set in the Properties window when the Installation Folder node is selected in the User Interface editor.

Settings

True - The Install MyApplication for yourself, or for anyone who uses this computer label and corresponding Everyone and Just me option buttons will be shown during installation, and the user's choice determines the installation method.

False - The Install MyApplication for yourself, or for anyone who uses this computer label and corresponding Everyone and Just me option buttons will not be visible during installation."

===========================================================

So here's Step-by-step what you do to install for Everyone as default without the radio button choices appearing for your users who are installing your product.: 1. Click on your setup project in your Solution Explorer. 2. Look in the Properties window and set the property InstallAllUsers to be True 3. Click on the icon in the Solution Explorer toolbar that has the pop-up tooltip "User Interface Editor" 4. Click on the "Installation Folder" item in the panel that appears. 5. Look in the Properties window and set the InstallAllUsersVisible to be False. 6. Rebuild your solution.

Some other additional notes to try from a quick search I have just done for you..

I was searching the web for an answer to this question, and I found the answer hidden away on Microsoft's site.

You are going to need Orca.exe from Microsoft. It is an MSI database editor. (http://msdn.microsoft.com/library/de...p/orca_exe.asp) The only way I see to get this file is by installing the Windows Installer SDK (http://www.microsoft.com/msdownload/...msdk/sdkupdate).

Once you are done building your .MSI file, you will need to open it with Orca.exe. Once open, go to the "Property" table. From the menu, Click "Tables" and then "Add Row". For the "Property" string, enter "ALLUSERS", for the value, enter "1" or "2". Entering a "1" will cause the installer to try to add the shortcut to "All Users" and fail if the current user does not have authority, a "2" will cause the installer to try "All Users" first, then fail over to their personal folder. For details - http://msdn.microsoft.com/library/de...stallation.asp

I tested this on "User's Desktop" and "User's Start Menu" and it worked for both. A word of warning: If you re-build your MSI file, it will delete the "ALLUSERS" property entry, so you must use Orca.exe and re-add the setting on each re-build.

I know this is an ancient question, but I've done this before and when I recently had to do it again I had forgotten how. Since my gut instinct was to look on SO before digging into old installer projects, I figured I'd better get the answer posted.

Here is how I accomplish this:

  1. Add a registry search to your launch conditions:

    在此输入图像描述

    • (Name): Search for All Users Programs menu
    • Property: ALLUSERSMENU
    • RegKey: SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders
    • Root: vsdrrHKLM
    • Value: Common Programs
  2. Create a new target folder in the file system editor and leverage your new property:

    在此输入图像描述

    • (Name): All Users Programs Menu
    • AlwaysCreate: True
    • DefaultLocation: [ALLUSERSMENU]\\YourMenuHere
    • Property: MENULOCATION
    • Transitive: False
  3. Place your shortcuts in that new folder.

That's it.

For reference here are the folder paths you can access in the registry for Windows XP:

在此输入图像描述

and for Windows 7:

在此输入图像描述

See ALLUSERS property on MSDN. The link in the first comment is broken.

http://msdn.microsoft.com/en-us/library/aa367559%28v=vs.85%29.aspx

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