2014-02-06 39 views
1

我正在使用VS2012 WPF應用程序& Install-shield 2013 LE生成安裝程序。「以管理員身份運行」選項不會顯示在資源管理器的上下文菜單中

安裝後,我注意到「以管理員身份運行」選項沒有顯示在desktop icon的資源管理器的上下文菜單中。

部分用戶無法運行應用程序,但他們可以通過進入已安裝的目錄運行該應用程序,並右鍵單擊以管理員身份運行的圖標。

我檢查了這個鏈接:http://msdn.microsoft.com/en-us/library/ms247046.aspx然後我添加了選項:「嵌入清單與默認設置」並重新生成安裝程序。但它沒有做任何改變。

我正在Win 7 OS 32bit上進行測試。

我怎樣才能啓用選項「以管理員身份運行」,當我右鍵單擊在資源管理器上下文菜單中的應用程序圖標?

同樣的問題這樣的問題:VS 2010 setup shortcut file not shows Run as Administrator option

app.manifest:

<?xml version="1.0" encoding="utf-8"?> 
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
    <assemblyIdentity version="1.0.0.0" name="MyApplication.app"/> 
    <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"> 
    <security> 
     <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3"> 
     <!-- UAC Manifest Options 
      If you want to change the Windows User Account Control level replace the 
      requestedExecutionLevel node with one of the following. 

     <requestedExecutionLevel level="asInvoker" uiAccess="false" /> 
     <requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> 
     <requestedExecutionLevel level="highestAvailable" uiAccess="false" /> 

      Specifying requestedExecutionLevel node will disable file and registry virtualization. 
      If you want to utilize File and Registry Virtualization for backward 
      compatibility then delete the requestedExecutionLevel node. 
     --> 
     <requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> 
     </requestedPrivileges> 
    </security> 
    </trustInfo> 

    <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> 
    <application> 
     <!-- A list of all Windows versions that this application is designed to work with. 
     Windows will automatically select the most compatible environment.--> 

     <!-- If your application is designed to work with Windows Vista, uncomment the following supportedOS node--> 
     <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"></supportedOS> 

     <!-- If your application is designed to work with Windows 7, uncomment the following supportedOS node--> 
     <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/> 

     <!-- If your application is designed to work with Windows 8, uncomment the following supportedOS node--> 
     <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"></supportedOS> 

    </application> 
    </compatibility> 

    <!-- Enable themes for Windows common controls and dialogs (Windows XP and later) --> 
    <dependency> 
    <dependentAssembly> 
     <assemblyIdentity 
      type="win32" 
      name="Microsoft.Windows.Common-Controls" 
      version="6.0.0.0" 
      processorArchitecture="*" 
      publicKeyToken="6595b64144ccf1df" 
      language="*" 
     /> 
    </dependentAssembly> 
    </dependency> 

</asmv1:assembly> 

enter image description here

enter image description here

編輯:

我計算出來的的Insta llShield 2013 LE(限量版)不允許我像這樣放置目標directioy:"C:\ProgramFiles\TestUtility.exe"。如果目標引用了exe,那麼'以管理員身份運行'將自動啓用。

原文:

enter image description here

它應該是這樣的:

enter image description here

所以,InstallShield將LE是不允許我改變這種狀況。

我必須找到另一種方式來生成安裝程序。有什麼建議嗎?

+0

您是否在鏈接的問題中嘗試瞭解決方案,如果是,它是否會失敗? –

+0

@TheodorosChatzigiannakis:我嘗試添加一個app.manifest文件並將其構建爲無。並生成一個新的安裝程序,但我沒有看到該選項。 – linguini

+0

請不要在問題標題中重複標籤。 –

回答

0

我終於找到爲什麼'以管理員身份運行'沒有啓用。當安裝的圖標未被引用到.exe時,它將不可用。

在此InstalShield 2013 LE版本的頂部不允許更改「目標目錄」值。

鏈接:http://community.flexerasoftware.com/showthread.php?206542-Permissions-setting-to-edit-within-directory

指.exe文件是很重要的;爲什麼?用戶可以通過Windows資源管理器上下文菜單以管理員身份運行應用程序。

我決定使用WIX安裝程序。

請給我你的FB。

相關問題