我正在使用以下脚本以管理员身份运行可执行文件:
#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 上,什么也没有发生。安装不要求用户提供任何东西,安装失败。
关于为什么会这样的任何想法或关于如何以管理员身份运行可执行文件的任何其他建议?