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

Recognizing installation cancel event


9 replies to this topic

kvsasi

kvsasi
  • Members
  • 8 posts

Posted 07 November 2002 - 17:29

I am invoking the installshield setup program from a jsp file. After the application is installed once and when the users try to install an update, if they press cancel during the update process, I'd like to put up a dialog with the question "Application update has been cancelled. Would you like to run the existing version anyway?". In order to do this, I need a way to query the ether object and figure out if the update was cancelled. There is a function called "isInstalled" on the ether object, but the function returns true even if cancel was pressed, because a previous version of the app is found.

Anybody know how to find out if cancel was pressed?

Thanks in advance

Sasi

Xitch13

Xitch13
  • Members
  • 134 posts

Posted 07 November 2002 - 18:51

The script fires an Abort event.  Then runs the function OnAbort().  Just add your code there
There is great chaos under heaven, and the situation is excellent. (Mao Tse Tung)

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 07 November 2002 - 19:36

Yes, OnAbort is the correct location.

However, from my experience IS don't always process that event depending upon where the user hit Cancel.

I've also found that my variables reset (i.e. Numbers go to 0, Strings go to "") upon abort which, in my opinion, is the dumbest thing ever!
user posted image

Xitch13

Xitch13
  • Members
  • 134 posts

Posted 07 November 2002 - 19:57

Hey Taco,

I know you've complained before about the Abort event.  When does that happen for you?  I'm curious for future installers I may write.

Plus, I'm sure you thought of these but, could you write your variables to a log file or (shudder) a registry entry (Only as a last resort)?
There is great chaos under heaven, and the situation is excellent. (Mao Tse Tung)

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 07 November 2002 - 20:17

Yeah, I have complained about that before.  The time it definitely doesn't work is from the standard Welcome screen.  Other times have worked, but I haven't tried all combinations.

Also, I am actually using a log file and that's the whole problem.  I'm trying to close the log file out upon onAbort, but the handle has been reset, so I'm unable to properly close it.  That's all I really want to do, but for now I only display the close error during debug mode.
user posted image

Xitch13

Xitch13
  • Members
  • 134 posts

Posted 07 November 2002 - 20:58

What about adding a CANCEL handler for your dialog boxes.  I currently only check for BACK (then go back, else forward).  I'm sure you can add " if nResult = CANCEL then ..."

As for the log file.  That's a tough one.  Hmm, let me think abt it
There is great chaos under heaven, and the situation is excellent. (Mao Tse Tung)

kvsasi

kvsasi
  • Members
  • 8 posts

Posted 07 November 2002 - 21:15

I could the onAbort() method if I want to pop up the dialog from within my installshield script, but I want to pop it up from my jsp code. Therefore I need to call some method on the ether object, to know whethere installation got aborted.

I think I can add a property to the script and set the property some value only if the installation got completed. Then I can query the property on the ether object to check whether the installation got cancelled. But this solution seems hacky. There has got be a simpler solution.

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 08 November 2002 - 03:35

Sorry kvsasi, missed the importance of how JSP comes into play.

Yeah, you'll probably need to use some intermediate item then.  Whether that be a file, registry entry, or something else is your choice.
user posted image

Xitch13

Xitch13
  • Members
  • 134 posts

Posted 08 November 2002 - 16:01

Hey Taco,  

I was thinking about your problem last night.  It sounds like a bug.  If IS won't allow you to release a resource on abort, it sounds like a problem.  Although, have you made sure that your log file is still open?  Maybe IS's garbage collection takes care of it automatically.
There is great chaos under heaven, and the situation is excellent. (Mao Tse Tung)

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 08 November 2002 - 21:13

Yeah, I haven't noticed a problem accessing the file or in its contents, so IS's garbage collection may be doing it for me.

However, I would agree it's a bug because what if I wanted to do something else based upon the condition of some other variable.  I'll submit something to IS then at some point here.
user posted image