从启动时以管理员身份运行快捷方式

时间:2011-09-12 13:52:16

标签: wix shortcut

我在Startup文件夹中创建了快捷方式。是否可以通过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>

1 个答案:

答案 0 :(得分:2)

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