【问题标题】:InstallScript XP安装脚本 XP
【发布时间】: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;

【问题讨论】:

标签: installshield installscript


【解决方案1】:

您已经在编写脚本了,所以我只想确定您是将LAAW_SHELLEXECUTEVERB 设置为runas,还是保留为open。您可以将 SYSINFO.nOSMajor 与 6 进行比较,或检查 SYSINFO.WINNT.bWinXP 以确定您在哪个操作系统上,并相应地选择动词。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-07-01
    • 1970-01-01
    • 2012-06-30
    • 2015-03-15
    • 1970-01-01
    • 2014-08-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多