简体   繁体   English

非管理员用户的 MSI

[英]MSI for non-admin users

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).我在 VS2015 中使用 NetOffice 并针对 .NET 2.0 制作了一个 Outlook 插件,现在我需要将其打包以供非管理员用户安装(它不需要管理员权限)。 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).我通常使用 ClickOnce 但它不见了(假设是因为我没有使用 VSTO?),所以我下载并安装了 Visual Studio 2015 安装程序项目(看起来很容易使用)。

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. 这个问题/答案似乎是我正在寻找的解决方案,但是当我运行 MSI 文件时,它仍然需要管理员密码。 After entering an admin password, all of the files are added to the user's AppData folder.输入管理员密码后,所有文件都会添加到用户的 AppData 文件夹中。 So why is still requiring an admin password?那么为什么仍然需要管理员密码? What am I missing here??我在这里错过了什么?

9 steps outlined in the SO question: SO问题中概述的9个步骤:

  1. Use a Type 51 Custom Action in the InstallUISequence to always unset the ALLUSERS (the per-user option)在 InstallUISequence 中使用 Type 51 自定义操作来始终取消设置 ALLUSERS(每用户选项)
  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.假设 ALLUSERS 始终设置为每用户设置,您可以使用可重定向文件夹属性,但不能使用 ProgramFilesFolder,因为它不会针对每个用户进行重定向。
  3. Install app to a location under LocalAppDataFolder.将应用程序安装到 LocalAppDataFolder 下的某个位置。
  4. All registry settings should be written to HKCU which is 1 in the Registry Table's Root column.所有注册表设置都应写入 HKCU,它在注册表表的根列中为 1。
  5. Flip bit 3 of the word count property in the summary information stream to signal no credential prompt is required.翻转摘要信息流中字数属性的第 3 位,以表示不需要凭据提示。
  6. If you have a bootstrapper (typically named setup.exe), manifest the requestedExecutionLevel to run asInvoker.如果您有引导程序(通常命名为 setup.exe),则将 requestsExecutionLevel 显示为作为 Invoker 运行。
  7. Pass ICE Validation as the ICEs have checks for incorrectly mixing per-user and per-machine state.通过 ICE 验证,因为 ICE 检查是否错误地混合了每个用户和每个机器的状态。
  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)第 1 步:设置项目 -> 查看 -> 用户界面 -> 将“InstallAllUsersVisible”设置为 False(根据 SO 答案)

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.第 2 步:在安装文件系统中,我添加了“用户的应用程序数据文件夹”,然后是“本地”,然后是“项目名称”,然后添加了项目输出 -> 主要输出。 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...第 3 步:我相信这就是我在上面所做的...

Step 4: I have not added any registry keys.第 4 步:我没有添加任何注册表项。 Is this something that is required?这是必需的东西吗?

Step 5: Per the SO answer, I downloaded Orca and opened the MSI file.第 5 步:根据 SO 答案,我下载了 Orca 并打开了 MSI 文件。 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.步骤 6:在安装文件属性中取消选中“创建安装程序以安装必备组件”后,我不再有 setup.exe 文件。

Step 7: I read a couple of blurbs on ICE Validation, but not really sure what I need to do here.第 7 步:我阅读了一些关于 ICE 验证的简介,但不太确定我需要在这里做什么。

Steps 8 and 9 skipped for now.暂时跳过第 8 步和第 9 步。

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].其他:在 Orca 中环顾四周时,我注意到 CustomAction 表中的 DIRCA_TARGETDIR 仍设置为程序文件夹,因此我将其更改为 [AppDataFolder][Manufacturer][ProductName]。

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.基本上,您应该确定 VSTO 注册需要哪些注册表项,并且只使用 Visual Studio 功能并忽略大部分旨在与 WiX 等工具一起使用的 SO 信息。

Your InstallAllUsers false is correct for a per user install.您的 InstallAllUsers false 对于每个用户安装是正确的。

To use LocalAppDataFolder go to the File System view, right click on that node and add a special folder, custom folder.要使用 LocalAppDataFolder,请转到 File System 视图,右键单击该节点并添加一个特殊文件夹,即自定义文件夹。 In the folder's properties window put [LocalAppDataFolder] in the DefaultLocation.在文件夹的属性窗口中,将 [LocalAppDataFolder] 放在 DefaultLocation 中。 Then that's where you add your files.然后就是你添加文件的地方。 That's it - do not mess around with DIRCA_ custom actions.就是这样 - 不要乱用 DIRCA_ 自定义操作。

If you uncheck the Prerequisites button you'll just get an MSI file, and that's what you install.如果您取消选中先决条件按钮,您将只获得一个 MSI 文件,这就是您安装的内容。 You need a setup.exe bootstrapper if you have prerequisites, which it will install followed by installing your MSI.如果您有先决条件,则需要 setup.exe 引导程序,它将安装,然后安装您的 MSI。

The UAC prompt is turned off in Orca with View-Summary Information and check the UAC Compliant box. Orca 中的 UAC 提示已通过查看摘要信息关闭,并选中符合 UAC 的框。 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.请注意,Windows Installer 不会仅仅因为它是安装而违反系统安全规则,因此如果安装程序尝试执行某些不允许受限用户执行的操作,它将失败。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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