Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

How to avoid an .ini file reset


7 replies to this topic

xav

xav
  • Members
  • 5 posts

Posted 20 December 2001 - 15:27

Hi,

I've got a problem during the uninstallation. I wrote instructions to modify some keys in the "notes.ini" file (initialization  file of Lotus Notes). This is done in the OnFirstUIBefore() function.

The problem is : when my setup.exe is launched a second time, InstallShield removes all the keys modified during the first installation. I tried first to add the following instructions in the OnFirstUIBefore() function.

OBJECT objLog;
begin
set objLog = LOG;
objLog.Property("State") = 0;
// custom stuff
// ...
end;

But the lines in the "notes.ini" are still erased.


I also tried to use this instrunction

Disable(LOGGING);

But the lines in the "notes.ini" are also erased.

Has anybody any ideas ?


Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 20 December 2001 - 17:15

Disable(LOGGING) should do it.  Are you using it in the right place?

According to the help:
"Disabling the logging of uninstallation information before calling DeinstallStart will have no effect since logging will be re-enabled automatically when DeinstallStart is called. You must disable logging manually immediately before performing operations that should not be logged for uninstallation."

Hope it helps.


xav

xav
  • Members
  • 5 posts

Posted 20 December 2001 - 17:22

I process like this :

function OnFirstUIBefore()
begin
Disable(LOGGING);
//...
// write in the notes.ini
// ...

Enable(LOGGING);
// ...
// beginning of dialogs label
// ...
end;


Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 20 December 2001 - 17:47

I'm certanly no IS expert, but iI would expect you're calling it _before_ DeinstallStart which according to the help is a problem.

xav

xav
  • Members
  • 5 posts

Posted 20 December 2001 - 18:15

I'm not personaly an IS expert. All I need is to avoid erasing the content of the notes.ini file during the uninstallation. If I can only call Disable(LOGGING) during the DeinstallStart function, this function is not usefull for me, because I modify the notes.ini before the installation.

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 20 December 2001 - 19:11

Okay, how about trying to do that stuff during OnBegin?

Another cheesy workaround would be to add code to restore the Notes file after the uninstall's completed, so under OnMaintUIAfter.


xav

xav
  • Members
  • 5 posts

Posted 21 December 2001 - 11:53

Than you for your answer. Unfortunately both solutions don't work.
OnBegin gives the same result.

For the second solution I processed like this ;
function OnMaintUIBefore()
begin
// setup default status
//-->Remove all components
// ...
Disable(LOGGING);
// copy my "SrcKey" key in the "TmpSrcKey" key,in my ini file

Enable(LOGGING);
end

then in the OnMaintUIAfter
function OnMaintUIAfter()
begin
// The "SrcKey" should be delated by Installshield
// copy my "TmpSrcKey" key in the "SrcKey" key,in my ini file
end;

I don't know in which function I can call Disable(LOGGING)


The problem is that ReplaceProfString does not work normaly. In the Installshied manual it is writen :

"If the key already existed when you called ReplaceProfString, the uninstallation will remove the newly added value if it meets all of the following conditions:
If szOrigValue is a subset of szReplaceValue. That is, if the string passed to ReplaceProfString in szReplaceValue equals the value of szOrigValue plus the values being added.
The new value must be appended as the first or last value of the existing value string. If the new value is added in the middle of the string, the uninstallation will not be able to remove it.
If only commas and semicolons are used as delimiters. "

Unfortunately, in my case, the whole key is removed.


xav

xav
  • Members
  • 5 posts

Posted 21 December 2001 - 14:24

I finally found a solution.
I read the notes.ini keys in the function OnMaintUIBefore(). They are set in global variables. Then I reate a new time the keys in the function OnMaintUIAfter().

Thank you for your help.