【发布时间】:2012-12-04 01:02:29
【问题描述】:
我有一个 installscriptmsi 项目,它的输出是 setup.exe。我可以在 Vista 及更高版本上安装它而没有任何问题。没有提示我输入 UAC。但在 XP 上,总是提示我运行为对话框。我知道这是因为设置了 LAAW_SHELLEXECUTEVERB = "runas" 我得到了 Run as prompt。但我确实希望我的安装程序在 XP 上以管理员身份运行。我还在 Release 下将RequiredExecutionLevel 设置为管理员。
那么有没有办法让 installscriptmsi 在 XP 上不提示 UAC。我正在使用 IS2012。我正在粘贴下面的脚本。
function OnBegin()
STRING szProgram, szCmdLine, szDirectory;
NUMBER nShowWindow, nTimeOut, nOptions;
STRING szTestVersionKey;
begin
szProgram = "MsiExec.exe";
szDirectory = "";
nShowWindow = SW_NORMAL;
nTimeOut = 1000 * 60 * 10;
nOptions = LAAW_OPTION_USE_SHELLEXECUTE;
LAAW_SHELLEXECUTEVERB = "runas";
RegDBSetDefaultRoot( HKEY_LOCAL_MACHINE );
// uninstall another 3rd party software if on the system.
szSofTestVersionKey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{15F6E1D5-12FF-4BBD-B02F-6440C7A2763C}";
if ( RegDBKeyExist(szTestVersionKey) ) then
szCmdLine = "/uninstall {15F6B1B5-12FF-4DBD-A02F-6640C7A2863C} /norestart /quiet";
LaunchApplication( szProgram, szCmdLine, szDirectory, nShowWindow, nTimeOut, nOptions );
endif;
end;
【问题讨论】:
-
你在说什么? Windows XP 没有 UAC。
-
@SLaks - 我的意思是作为对话框运行,如 - helpnet.flexerasoftware.com/installshield19helplib/Subsystems/… 所述
标签: installshield installscript