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

Script-Defined Folders on uninstall


6 replies to this topic

tfa613

tfa613
  • Members
  • 4 posts

Posted 05 August 2002 - 23:09

Hallo,

I want to clean up directories on uninstall. These directories are installed by the IS. To this directories are files copied by the installed program.
These Directories are set by
ComponentSetTarget(MEDIA, "<DATADIR>", szDataDir);
Is it possible to get the value on uninstall?

Thanks for any help,
                           Torsten.

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 06 August 2002 - 02:03

Get what value?  The value of DATADIR/szDataDir?

Most installs manually save off the installed location to the registry for future use.  However, if you've failed to do this, I don't think the uninstall auto. pick this back up, but to find out just add some debug messages or run through it with the debugger and see what you get.

I'm guessing you are a bit of a newbie, so when you do, you'll most likely want to focus on OnMainUIBefore & OnMainUIAfter.
user posted image

tfa613

tfa613
  • Members
  • 4 posts

Posted 06 August 2002 - 05:34

Hope I did understand everything correctly, sure I'm a bit newbie in using installshield:

I need to get the value of that, what in the install process is assigned to <DATADIR>, the target directory of my data in szDataDir.
May be I can get this value (of szDataDir on install) on uninstall like <TARGETDIR>?

Torsten.

Lucky

Lucky
  • Members
  • 119 posts

Posted 06 August 2002 - 13:57

I think the easiest way would be to save the installation path in someregistry entry, and try to read it in the OnBegin event handler.

tfa613

tfa613
  • Members
  • 4 posts

Posted 06 August 2002 - 14:14

Ok, thank you all for help,
I thought that this will be done by the Installshield "automatically" and I can read it by an scriptfunction like ComponentGet...()

Torsten.

ramaswamy

ramaswamy
  • Members
  • 25 posts

Posted 06 August 2002 - 19:47

Hi,

Once you have set the varaibles using
ComponentSetTarget(MEDIA, "<DATADIR>", szDataDir);

declare szDataDir as a globbal variable and have the following line in the function OnMaintUIBefore

szDataDir=TextSub.Value("szDataDir")

This might work, usually I have the first line as
ComponentSetTarget(MEDIA, "<szDataDir>", szDataDir); -- both the script-defined variable and my global variable same.

Hope this helps

tfa613

tfa613
  • Members
  • 4 posts

Posted 07 August 2002 - 10:42

cool, this works,
I can use

szDataDir = TextSub("DATADIR")

witch extraxts me the path of the directory decared as <DATADIR> in the Script-Defined Folder.

Thank you!

Torsten.