Thursday 11 January 2018

How To : Group Policy Processing ( GPP ) : Add / Edit / Remove INI FIle

It is a common practice for applications to have configurations set in INI file. It may contain information such as language, key, connection setting, version, and so forth. Updating INI file might not affect the application coding, but it may affect on how the application behave. There are multiple ways to update the file, one of it is by using Group Policy Preference ( GPP ). 

In this example, I want to update a key file at a specific location with a specific information.

Information : 

  • File Location : C:\Temp\key\keyfile.key
  • Content of AppsKey.key :
          [Setup]
          Key=XXXX-XXXX-XXXX-XXXX



As mentioned by Microsoft here, below format must be followed :
[SectionName]
PropertyName1=PropertyValue1
PropertyName2=PropertyValue2

How To Do :

  1.  Edit the policy. Navigate to Preference | Windows Settings



  2.  Right click INI Files | New | Ini File




  3.  This screen will appear...


    Action = Different action will do different thing. Refer to the table below
    File Path = where to put the file. If the folder does not exist, the folder will be created. If the file does not exist, the file will be created. If the file exists, the action will affect the INI file content.
    SectionName = In which section the key will resides
    PropertyName = the property of the key
    PropertyValue = value of the key

  4. Therefore...
    Action = Replace
    File Path = C:\Temp\key\keyfile.key
    SectionName = Setup
    PropertyName = ApplicationKey
    PropertyValue = XXXX-XXXX-XXXX-XXXX




  5.  If there are more keys needed, create more entries. Note that, Update and Replace will give the same result.


  6.  Outcomes!



    Share:
    Location: Auckland, New Zealand

    0 comments:

    Post a Comment