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

Uninstalling Myself from a Script


10 replies to this topic

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 10 December 2001 - 20:11

--IS 6.31, Program-Based Script--

During the initial extraction portion, I'm getting this access denied error when trying to run the resulting uninstall routine directly from the same script.

Error:
"An installation support file 'C:\TEMP\{058FA046-26C0-46F9-B656-983182ED0DF0}\isrt.dll'
could not be installed.

Access is denied."

Script Code:
LaunchAppAndWait("RunDll32"," C:\\PROGRA~1\\COMMON~1\\INSTAL~1\\engine\\6\\INTEL3~1\\Ctor.dll,LaunchSetup \"C:\\Program Files\\InstallShield Installation Information\\{058FA046-26C0-46F9-B656-983182ED0DF0}\\Setup.exe\" -l0x9  -uninst ",WAIT);

If I run this same thing outside of my script, I don't have a problem.

Now I'm thinking the problem is because I'm trying to do this all from myself.  In other words, I installed and am now try to run the resulting uninstall all within the same setup.  This is probably why the -uninst switch does not read the script.

Any feedback and/or comments would be greatly appreciated, but everyday it's looking like a wrapper is the beter way to go as I don't want to move to an event--based model just yet.



runningquicklynowher

runningquicklynowher
  • Members
  • 20 posts

Posted 10 December 2001 - 21:54

sounds like you are getting a sharing error.  I sometimes get a similar error when I start an install immediately after after closing one due to the first one not having finished its closing out routine yet.  Only suggestion I can think of, seeing as how the install and the uninstall will share files and conflict when runing concurrently, is to check your logic and see if it is possible to run the uninstall at the very end after your install is finished.

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 10 December 2001 - 22:51

The actual install's already done.  The way this works is I've modified the default Add/Remove Program entry to include my custom command line parameter.  I check for that and if it exists, run the nec. uninstalls from my script.

Moving it down therefore is not really applicable.


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 11 December 2001 - 18:58

The problem is that two IS 6.0/6.1/6.2 created setups cannot run simultaneously. IS 6.3 added this capability. Maybe you can use DoInstall instead.

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 11 December 2001 - 19:01

But as I stated in my original post I am using IS 6.3.1, so if what you're saying is correct, that shouldn't be the problem.

lasenbby

lasenbby
  • Members
  • 744 posts

Posted 11 December 2001 - 19:49

In your install, in onfirstuia, rewrite the uninstall string in the registry to DISK1TARGET^"SETUP.EXE"...  May have to use \" to get quotes around it all so it takes the command line param.

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 11 December 2001 - 20:50

Okay, I changed the uninstall string as suggested, but I still get the same error.

Also, DoInstall won' t work because the it only allows for the filename to be Setup.inx.

Let me just try and clarify where I see the error.  Both before this last change and now, the the setup launches from Add/Remove okay and runs the script code.  I can identify the passed command line argument and subsequently call the uninstall routine.  It is when this guy is extracting that I see the access denied error.


lasenbby

lasenbby
  • Members
  • 744 posts

Posted 11 December 2001 - 21:42

I think I just got what you are trying to do, correct me if I'm wrong.

You have a program block based script.  You want to uninstall if it is run from the add/remove applet, otherwise install.  So you, during your program block script, try to call the setup.exe again (which btw is going to be the same product_guid) to uninstall it.  

That is not going to work because the initial running of the script creates the supportdir and places dlls that are required.  Then you try to run the uninstall for the same product_guid and it wants to use the same EXACT dir as supportdir but it cannot overwrite the dlls that are in use (locked).

(Once again I reiterate I only find problems with program block scripts in 6.x.  I have heard of nobody that prefers this over event driven script.)

However, you just want to be able to uninstall right?  Do not attempt to call the setup.exe again in your script.  In the onmaintuib, call componentremoveall and let IS do its job.  I do not know if this will work but I know what I described above is not going to work.

One thing you need to check, because I don't know how it works is if under:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\PRODUCT_GUID
if the uninstall reg entries are made.  If they are not then you will not get maintenance mode and this is your problem.  If this is the case, you will have to make the reg entries in your script.  You also need to check that c:\program files\InstallShield Intallation Information\PRODUCT_GUID is made with the uninstall support files.  If not, this also is a reason for IS not going into maintenance mode.  Both of these must be there for IS to go into maint mode.  ####, I don't even know if you can go into maint mode in a program block script.  Maybe just calling componentremoveall will work.

(Edited by lasenbby at 8:46 pm on Dec. 11, 2001)


Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 11 December 2001 - 23:59

WARNING:  Long reply follows ...

You got it, or as I like to say, "Now you're pickin' up what I'm layin' down!"

Yeah, I figured my problem was something along the lines of locked files due to the scenario you describe.

Also, it's not that I prefer program block scripts.  I just don't want to move to an event-driven model for this update.  I inhereted this install from my predecessor and am trying to work with keeping it somewhat intact for this go around.

I've actually tried switching a copy of my setup over to being event-driven based and saw how I would do this same kind of thing.  Although I think that I'd actually have the same access problems since I'd be doing the same kinds of things.

As for using ComponentRemoveAll, from the help, it sounds like it would for the most part work.  The one problem though is that it doesn't sound like it would clean up the associated/resulting registry entries.

To answer your question, the uninstall reg. entries and support files all exist.  This is why the default entry works just fine.

In the end, I'll want to run several diff. uninstalls, but I need to get this one working first.  To do so, I'll probably just end up using a wrapper such as another IS setup or a C++ application 'cause this is becoming ever more complicated/difficult the further I get.

BTW, there isn't really such a thing as maintenance mode is a program block script.  Unless one were to override the MAINTENANCE system variable to TRUE and make the appropriate calls as necessary, then you "should" get similar behavior.

In any case, thanks for the help lasenbby.


lasenbby

lasenbby
  • Members
  • 744 posts

Posted 13 December 2001 - 00:01

ComponentRemoveall is basically all that tells IS in and event driven script to remove using the ilg (log) file.  It should remove all reg entries, files, etc. (in as much as IS does, which, IMO is not very well.)

You should at least try it on a new machine with single install.


Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 13 December 2001 - 02:16

Yes, that did indeed reg. entries as well.  Excellent!

I now have the functionality that I was going for in place.  I just need to work on improving the presentation a little.  Thanks for all the help.