Be careful when you want to perform remote installation by using an AIT file in which an API function that manipulates the HKEY_CURRENT_USER hive is specified. If the logged-on user of a remote installation target computer is not a member of the Administrators group, the function manipulates the HKEY_USERS\.DEFAULT key, instead of HKEY_CURRENT_USER. In this case, to manipulate the HKEY_CURRENT_USER hive, you need to use Run from the Start menu to import the relevant registry file.
To manipulate the HKEY_CURRENT_USER hive during remote installation using an AIT file:
while(iLoopCount < iLoopMax)
if((AITEVENTFLAG1==0) && (AITIGNORE == 0))
// Displays the Start menu.
AIT_PlayKey("{LWIN}");
AIT_Sleep(SLEEP_TIME_EVENTS);
// Chooses Run.
AIT_PlayKey("r");
AIT_Sleep(SLEEP_TIME_EVENTS);
AITEVENTFLAG1 = 1;
AITIGNORE = 1;
iLoopCount = 0;
endif;
if((AITEVENTFLAG1==1) && (AITIGNORE == 0) && (AIT_FocusWindow("Run", "#32770") != 0))
// Enters the path of the registry file.
AIT_GetCurrentDirectory(strPath);
AIT_PlayKey("regedit.exe /s '"" + strPath + "'\Sample.reg'"");
AIT_Sleep(SLEEP_TIME_EVENTS);
// Imports the registry file.
AIT_PlayKey("{ENTER}");
AIT_Sleep(SLEEP_TIME_EVENTS);
iLoopCount = iLoopMax;
DM_RTN = OK_END;
continue;
endif;
AITIGNORE = 0;
iLoopCount = iLoopCount + 1;
AIT_Sleep(SLEEP_TIME);
loop;