I strongly advise you to use UnitTest___ repository to see an example of how to use ICIniFile setup.
Usually Add-on code should follow these steps.
- Open file
- If return false, go to step 2.
- If return true, go to step 3.
- Create file
- If return false, then user does not have permission for directory/file.
- If return true, go to step 1.
- Load data
- If return false, then there’s a problem with file’s data.
- If return true, go to step 4.
- Check section or key exist
- If return false, go to step 5.
- If return true, go to step 6. (only for key exist)
- Add section or key
- If return false, then there’s a problem with your code or user’s side.
- If return true, go to step 6.
- Get key
- If return false, go to step 5.
- If return true, go to step 7.
- Save data
- If return false, then there’s a problem with either your code or internally.
- If return true, go to step 8.
- Close file
- Release (Required, can be put in EAOUnload function)