2011-09-12 36 views
6

我在Startup文件夾中創建了快捷方式。是否可以通過wix爲我的快捷方式添加「以管理員身份運行」屬性?在這裏我的代碼:以admin身份運行啓動時的快捷方式

<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> 
+0

你建立你的快捷方式指向的應用程序,或者是它的東西,你沒有源代碼? –

+2

你想*在快捷方式的上下文菜單中以管理員*命令運行嗎?還是你想在系統啓動時啓動你的應用程序的快捷方式(具有管理員權限)? - 後者不起作用。 –

+0

是的,我想在快捷方式的上下文菜單中使用此命令。我沒有可執行文件的源代碼。 – Nerielle

回答

相關問題