本文介绍了使用VS 2015 Professional创建无需管理员特权即可运行的安装程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个无需管理员特权即可运行的安装文件(MSI).为此,我尝试了波纹管选项.

  1. 我已将 InstallAlluser 属性设置为 false ,如下所示.
  1. 还将 InstallAllUsersVisible 设置为 false
  1. 我还使用 [AppDataFolder]
  2. 更改了默认位置

更改以上属性后,仍然需要管理员权限才能执行使用安装程序项目创建的MSI文件.

能帮我解决这个问题吗?

预先感谢.

解决方案

使用Orca打开MSI时(

您应该真正使用比Visual Studio安装程序项目更灵活,功能更强大的MSI工具.它们有几个用途,但缺乏灵活性,还有许多其他问题:().

在WiX中进行简单的按用户文件夹安装(在显示为"PUT-GUID-HERE" 的位置插入大写GUID (2次)-您可以使用此GUID生成器):

 <?xml version ="1.0"encoding ="UTF-8"?< Wix xmlns ="http://schemas.microsoft.com/wix/2006/wi"><产品ID ="*"名称="PerUserSample";语言="1033"版本="1.0.0.0"制造商=-"UpgradeCode ="PUT-GUID-HERE"< Package InstallerVersion ="200"压缩=是".InstallScope ="perUser";InstallPrivileges =受限"./>< MajorUpgrade DowngradeErrorMessage =已经安装了[ProductName]的较新版本."/>< MediaTemplate EmbedCab =是";/>< UIRef Id =" WixUI_Mondo"/>< Feature ID ="ProductFeature";标题="PerUserSample".等级="1"./><目录ID ="TARGETDIR";名称="SourceDir"<目录ID ="AppDataFolder"><目录ID =某事";名称=东西"< Component Feature ="ProductFeature";Guid ="PUT-GUID-HERE".< RegistryValue Root ="HKCU";密钥=软件\ [制造商] \ [产品名称] \测试"名称=已安装"类型=整数".值="1".KeyPath ="yes"/><文件源="C:\ Windows \ Notepad.exe"/>< RemoveFolder ID =某事";目录=某事"开启=卸载";/></Component></目录></目录><目录ID ="ProgramFilesFolder"><目录ID ="INSTALLFOLDER";名称="PerUserSample";/></目录></目录></产品></Wix> 

I'm trying to create a setup file (MSI) that runs without admin privileges. for that, I've tried the bellow option.

  1. I've set InstallAlluser property to false as bellow.
  1. Also set InstallAllUsersVisible to false
  1. I've also changed Default location with [AppDataFolder]

After changes above properties It still required Administrator permission to execute MSI file that created using Setup project.

Can you please help me to resolve this issue.

Thanks in Advance.

解决方案

When you open your MSI with Orca (or equivalent MSI viewer), do you see the "UAC Compliant" check box checked? Sample screenshot here:

You should really use a more flexible and capable MSI tool than the Visual Studio Installer projects. They are good for a few purposes, but lack flexibility and there are numerous other problems: summary of VS Project problems (short form).

A simple per-user folder installation in WiX (insert UPPERCASE GUIDs in locations shown with "PUT-GUID-HERE" (2 occurrences) - you can use this GUID generator):

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Product Id="*" Name="PerUserSample" Language="1033" Version="1.0.0.0" Manufacturer="-" UpgradeCode="PUT-GUID-HERE">
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perUser" InstallPrivileges="limited" />

    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
    <MediaTemplate EmbedCab="yes" />
    <UIRef Id="WixUI_Mondo" />

    <Feature Id="ProductFeature" Title="PerUserSample" Level="1" />

    <Directory Id="TARGETDIR" Name="SourceDir">

      <Directory Id="AppDataFolder">
        <Directory Id="Something" Name="Something">
          <Component Feature="ProductFeature" Guid="PUT-GUID-HERE">

            <RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]\Test"
                           Name="installed" Type="integer" Value="1" KeyPath="yes"/>

            <File Source="C:\Windows\Notepad.exe" />

            <RemoveFolder Id="Something" Directory="Something" On="uninstall" />

          </Component>
        </Directory>
      </Directory>

      <Directory Id="ProgramFilesFolder">
        <Directory Id="INSTALLFOLDER" Name="PerUserSample" />
      </Directory>

    </Directory>

  </Product>

</Wix>

这篇关于使用VS 2015 Professional创建无需管理员特权即可运行的安装程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 23:44