Hitachi

JP1 Version 12 JP1/IT Desktop Management 2 Distribution Function Administration Guide


19.3.3 Manipulating the HKEY_CURRENT_USER registry key during remote installation

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:

  1. Create the registry file.

    Create the registry file for the registry branch that you want to add or edit.

    Important

    It is recommended that you back up the registry and understand how to restore the system before manipulating the registry.

  2. Create an AIT file.

    The following gives an example of coding that chooses Run from the Start menu, executes regedit.exe, and then imports the desired registry file. In this example, Sample.reg is the registry file to be imported.

    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;
  3. Store the created registry file in the same directory as for the software to be distributed.

  4. Perform packaging, specifying the created AIT file.

  5. Perform remote installation.

    The registry file will be copied to the same directory as for setup.exe, and the AIT file will be executed at the remote installation target computers.