-1

I made an Outlook Add-in in VS2015 using NetOffice and targeting .NET 2.0, now I need to package it for non-admin users to install (it cannot require admin rights). I typically use ClickOnce but it's missing (assume because I'm not using VSTO?), so I downloaded and installed the Visual Studio 2015 Installer Project (seemed easy to use).

This SO question/answer seems to be the solution I'm searching for but when I run the MSI file it still requires an admin password. After entering an admin password, all of the files are added to the user's AppData folder. So why is still requiring an admin password? What am I missing here??

9 steps outlined in the SO question:

  1. Use a Type 51 Custom Action in the InstallUISequence to always unset the ALLUSERS (the per-user option)
  2. Files must be written only to folders that Standard User has access to. Assuming the ALLUSERS is always set to the per-user setting, you can use the redirectable folder properties but not ProgramFilesFolder as it does not redirect on per-user.
  3. Install app to a location under LocalAppDataFolder.
  4. All registry settings should be written to HKCU which is 1 in the Registry Table’s Root column.
  5. Flip bit 3 of the word count property in the summary information stream to signal no credential prompt is required.
  6. If you have a bootstrapper (typically named setup.exe), manifest the requestedExecutionLevel to run asInvoker.
  7. Pass ICE Validation as the ICEs have checks for incorrectly mixing per-user and per-machine state.
  8. Test both from a Standard User account and from an elevated command prompt to confirm behavior.
  9. Provide your users’ documentation of the user specific nature of the package as this is atypical in today’s application installs.

Here's what I've done:

Step 1: Setup project -> View-> User Interface -> set "InstallAllUsersVisible" to False (per SO answer)

Step 2: In the setup file system I added "User's Application Data Folder", then "Local", then "ProjectName", and then added the Project Output -> Primary Output. I tried to remove the "Application Folder" but it says it's required and won't be deleted.

Step 3: I believe this is what I did above...

Step 4: I have not added any registry keys. Is this something that is required?

Step 5: Per the SO answer, I downloaded Orca and opened the MSI file. However, when I go to View -> Summary Information and look for the word count property it's not there. I've looked through all of tables and can't find it anywhere.

Step 6: After unchecking "Create setup program to install prerequisite components" in the Setup file properties I no longer have a setup.exe file.

Step 7: I read a couple of blurbs on ICE Validation, but not really sure what I need to do here.

Steps 8 and 9 skipped for now.

Other: While looking around in Orca I noticed in the CustomAction table that the DIRCA_TARGETDIR was still set to the Program Folder so I changed it to [AppDataFolder][Manufacturer][ProductName].

PhilDW
  • 20,260
  • 1
  • 18
  • 28
pheeper
  • 1,457
  • 4
  • 20
  • 37
  • I've authored many office addin installers / blog articles over the years. IMO the whole point of using MSI is so you can have a bootstrapper to install all of your prereqs and install your MSI per-machine. If your requirement is per-user / never require elevated rights, why not just use ClickOnce? I might not care for it myself but that is what it was designed for. – Christopher Painter Sep 28 '17 at 22:17
  • I've always used ClickOnce, but for this addin I can't use VSTO (not installed on user machines). So I'm using NetOffice and created my project using their "Developer Toolbox". When I open it in VS2015 and go to project properties, the Publish tab is missing and ClickOnce is greyed out under the Signing tab. If I could figure out how to use ClickOnce I would in an instant. – pheeper Sep 28 '17 at 22:42
  • Hmmm.. I've never used that SDK. Maybe there is a Import targets you could add to the MSBuild project file they generate that could enable that. Another option would be to look at https://github.com/Squirrel/Squirrel.Windows .. don't get me wrong, I love MSI and I love per-machine installs but if your story really is per-user I think there are other options you might like better. – Christopher Painter Sep 29 '17 at 00:21

1 Answers1

0

Basically you should work out what registry entries are required for a VSTO registration and just use Visual Studio features and ignore most of that SO information that is intended for use with tools such as WiX.

Your InstallAllUsers false is correct for a per user install.

To use LocalAppDataFolder go to the File System view, right click on that node and add a special folder, custom folder. In the folder's properties window put [LocalAppDataFolder] in the DefaultLocation. Then that's where you add your files. That's it - do not mess around with DIRCA_ custom actions.

If you uncheck the Prerequisites button you'll just get an MSI file, and that's what you install. You need a setup.exe bootstrapper if you have prerequisites, which it will install followed by installing your MSI.

The UAC prompt is turned off in Orca with View-Summary Information and check the UAC Compliant box. Note that Windows Installer does not violate system security rules just because it's an install, so if the setup tries to do something that is not allowed to limited users it will fail.

PhilDW
  • 20,260
  • 1
  • 18
  • 28