使用VS 2015 Professional创建无需管理员特权即可运行的安装程序 [英] Create setup that run without admin privileges using VS 2015 Professional

查看:45
本文介绍了使用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次)-

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).

Per-User setups considered harmful: Some words of warning against per user setups. Here is one more answer on that.

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创建无需管理员特权即可运行的安装程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆