我使用下面的脚本来运行一个可执行文件作为admin管理员:运行可执行文件中的InstallScript
#include "ifx.h"
export prototype MyFunction(HWND);
///////////////////////////////////////////////////////////////////////////////
//
// Function: MyFunction
//
// Purpose: Calls into Companion to execute the detect camera and all init setup
// code
//
///////////////////////////////////////////////////////////////////////////////
function MyFunction(hMSI)
begin
if REMOVEALLMODE ==0 then //only run if they are installing the product
LAAW_SHELLEXECUTEVERB = "runas";
LaunchApplication (INSTALLDIR^"Companion.exe",
"-detect -test -wsdl -exit -nimbus",
"",
SW_NORMAL,
0,
LAAW_OPTION_WAIT_INCL_CHILD | LAAW_OPTION_USE_SHELLEXECUTE);
endif;
end;
在XP上,上面的脚本将打开一个对话框,询问用户其用户可执行的应作为...运行。这使他们可以选择一个管理员来运行可执行文件。但是,在Windows 7上,没有任何反应。安装不会询问用户任何内容,并且安装失败。
任何想法,为什么这可能是或任何其他建议如何作为管理员运行可执行文件?
使用LAAW_SHELLEXECUTEVERB = “运行方式” 应引起W7和Vista把一个UAC提示。 – ajs410 2012-02-29 17:57:43