【问题标题】:Run as admin the shortcut from startup以管理员身份运行启动时的快捷方式
【发布时间】:2011-11-15 09:11:17
【问题描述】:

我在启动文件夹中创建了快捷方式。是否可以通过wix为我的快捷方式添加“以管理员身份运行”属性?这是我的代码:

<Component Id="AutostartService" Guid="GUID">  
    <Condition>AUTOSTART="1"</Condition>  
    <RegistryKey Action="createAndRemoveOnUninstall" Root="HKCU"
                 Key="Software\$(var.Manufacturer)\$(var.ProductName)\$(var.ApplicationName)">  
        <RegistryValue Name="ShortcutAutostart"
                       Type="integer" Value="1"
                       KeyPath="yes">  
        </RegistryValue>  
    </RegistryKey>  
    <Shortcut Advertise="no" Directory="StartupFolder"
              Name="Service"
              Target="[INSTALLLOCATION]Service.exe"  
              Id="SHORTCUT_auto"  
              WorkingDirectory="INSTALLLOCATION" >  
    </Shortcut>  
    <RemoveFile Id="remove_autostart" Name="Service"   On="uninstall"/>  
</Component>

【问题讨论】:

  • 您是在构建快捷方式指向的应用程序,还是您没有源代码?
  • 您希望在快捷方式的上下文菜单中使用 以管理员身份运行 命令吗?或者您是否希望在系统启动时启动应用程序的快捷方式(具有管理员权限)? — 后者行不通。
  • 是的,我想在快捷方式的上下文菜单中使用此命令。而且我没有可执行文件的源代码。
  • 如果您只想在快捷方式上下文菜单中显示 以管理员身份运行 命令,请检查您的快捷方式是否未广告:右键单击它,然后单击 属性Target 应该是可执行文件的路径。查看您的 WiX 代码,我认为是这种情况,因此该命令应显示在上下文菜单中。
  • 谢谢,我想是否有任何方法可以在安装过程中启用快捷方式属性中的“运行方式”复选框,但似乎我想要的更多

标签: wix shortcut


【解决方案1】:

不,不支持,因为它是"the wrong thing to do."

猜你喜欢
  • 1970-01-01
  • 2011-05-07
  • 1970-01-01
  • 1970-01-01
  • 2011-04-12
  • 2010-09-09
  • 2021-05-27
  • 2016-08-31
  • 2015-05-13
相关资源
最近更新 更多