4

I have a C# application, and a Visual Studio (2010) Setup Project with it. In my Setup Project, I am using InstallAllUsers = True. Additionally, my application needs to launch at Startup, so a shortcut is being added to the User's Startup Folder.

So I install my application as user Bob (from a share), and then I log off and log on as user Alice. Alice gets a dialogue that says:

The feature you are trying to use is on a network resource that is unavailable.

It provides the network path from which the MSI was installed. So, basically, it's looking for the MSI on a share that Alice doesn't have access to. This is repeatedly reproducible if Alice tries to manually launch the Startup link. However, Alice can directly launch the exe from the installation location, which works fine.

I don't fully understand why it is looking for an MSI, but I guess it makes sense that an application can not be completely installed by one user for another user, so the MSI is needed to complete the installation.

But if that is the case, then I don't understand why the MSI only seems to be required when launching from the Startup link, and not from the exe directly.

My question has several parts:

  1. Is what I am experiencing expected behaviour for the InstallAllUsers option?
  2. If so, how can I ensure that my application is fully installed for all users?
  3. Is it necessary to copy the msi locally, and ensure that it does not get deleted before each user has had a chance to log on?
Eric
  • 5,842
  • 7
  • 42
  • 71
  • I would check the shortcut file and see where it's pointing from. `InstallAllUsers` doesn't look for an MSI when a different user uses the application. – code4life Mar 28 '12 at 21:26
  • Are the network drives mapped the same for both users? – Jetti Mar 28 '12 at 21:34
  • @code4life, really? That would be good news for me... unfortunately the shortcut gives me almost no information. In properties, it lists the `Target` (which is greyed out) as my application name (not the filename - the display name). `Target location` is blank, and `Start in` is set to the full containing path of my application exe (not including the exe, just the containing path). – Eric Mar 28 '12 at 21:39
  • @Jetti, no - it's not installed off of a network drive either. Just a UNC path. – Eric Mar 28 '12 at 21:39
  • @Eric: if you create a new shortcut manually, does it work? If so, your problem is definitely a bug in the original shortcut (probably pointing to the MSI or whatnot)... – code4life Mar 28 '12 at 21:54

2 Answers2

2

This is happening because the shortcuts are "advertised shortcuts" hence the greyed out target box.

More info here...

http://www.advancedinstaller.com/user-guide/advertised-shortcuts.html

When an advertised shortcut is launched it validates the checks associated with the key resources. If any is missing it will fix it by running the installation package and installing again all information from the .msi file.

This is why its trying to run the msi.

You can turn off advertised shortcuts by reading this article...

DISABLEADVTSHORTCUTS=1 disables all shortcuts

If its an all users install, then the shortcut will probably want to reside in the all users start menu. Win 7: C:\ProgramData\Microsoft\Windows\Start Menu.

Community
  • 1
  • 1
TomP89
  • 1,420
  • 3
  • 11
  • 29
1

Eric, I would recommend taking a look at the shortcut file contents. You can do this by using Powershell, and there is a SO link to help you on your way:

Editing shortcut (.lnk) properties with Powershell

Community
  • 1
  • 1
code4life
  • 15,655
  • 7
  • 50
  • 82