版权声明: 可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息。
这是一段示例代码,仅供参考。
此问题不会彻底解决安装包在Vista/Windows 7上的权限提升问题,至少对本次安装包是无效的。
另外,我们也不建议某个应用程序的安装包代替用户决定UAC是否关闭。
function OnBegin()
STRING szKey, szName, szValue;
NUMBER nType, nSize;
begin
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
szKey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System";
// Set up parameters for call to RegDBSetKeyValueEx.
szName = "EnableLUA";
szValue = "0";
nType = REGDB_NUMBER;
nSize = -1;
// Set a key name and a value associated with it.
if (RegDBSetKeyValueEx (szKey, szName, nType, szValue,
nSize) < 0) then
MessageBox ("RegDBSetKeyValueEx failed.", SEVERE);
abort;
endif;
end;
STRING szKey, szName, szValue;
NUMBER nType, nSize;
begin
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
szKey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System";
// Set up parameters for call to RegDBSetKeyValueEx.
szName = "EnableLUA";
szValue = "0";
nType = REGDB_NUMBER;
nSize = -1;
// Set a key name and a value associated with it.
if (RegDBSetKeyValueEx (szKey, szName, nType, szValue,
nSize) < 0) then
MessageBox ("RegDBSetKeyValueEx failed.", SEVERE);
abort;
endif;
end;