I am using a TIniPropStorage on my main form to store some program settings. In general, it works great. But, the program runs from a directory that is read-only for some users, and it throws an exception when they try to close (cannot write ini file...).
I thought that this would be an easy fix, but I can't find a simple way of shutting off/preventing the "save" function. I tried this:
type
TIniPropStorageCracker = class(TIniPropStorage);
procedure TfrmMain.FormClose(Sender: TObject; var CloseAction: TCloseAction);
begin
if FileExists(TIniPropStorageCracker(IniPropStorage).GetIniFileName) then begin
IniPropStorage.Active := False;
end;
end;
Setting "Active" to false, does NOT prevent saving to the ini file. I looked through the source, and cannot find a simple way to fix this.
Am I missing something? Any help would be appreciated.
Thanks,
Wayne