PDA

View Full Version : Cancel install



NewsArchive
08-02-2010, 01:52 PM
Hi Friedrich,

Is there any way to take actions in the script if the install is cancelled?
In one of my installs I check/write to a file at the beginning of it that
under certain circumstances I need to undo if the install is cancelled. Any
ideas on how to accomplish that?

Best regards,

--
Arnór Baldvinsson - Icetips Alta LLC
Port Angeles, Washington
www.icetips.com - www.buildautomator.com - www.altawebworks.com

Icetips product subscriptions at http://www.icetips.com/subscribe.php

NewsArchive
08-02-2010, 01:53 PM
Set a flag where the code would only get touched on the final dialog?

So if aborted, it never gets set?

Jeff Slarve

NewsArchive
08-02-2010, 01:53 PM
Jeff,

> Set a flag where the code would only get touched on the final dialog?
> So if aborted, it never gets set?

I was going to suggest something similar but where in the script does
Arnor's undo get processed when the script is cancelled?<g>

--
Lee White

RPM Report Viewer.: http://www.cwaddons.com/products/rpm/
RPM Review........: http://www.clarionmag.com/cmag/v11/v11n06rpm.html
Report Faxing.....: http://www.cwaddons.com/products/afe/
---Enroll Today---: http://CWaddons.com

Enhanced Reporting: http://www.cpcs-inc.com

NewsArchive
08-02-2010, 01:53 PM
> I was going to suggest something similar but where in the script does
> Arnor's undo get processed when the script is cancelled?<g>

That "other" product I used before, which will remain nameless<g>, had
an exit point where you could add script for cancelled processing.

--
Lee White

RPM Report Viewer.: http://www.cwaddons.com/products/rpm/
RPM Review........: http://www.clarionmag.com/cmag/v11/v11n06rpm.html
Report Faxing.....: http://www.cwaddons.com/products/afe/
---Enroll Today---: http://CWaddons.com

Enhanced Reporting: http://www.cpcs-inc.com

NewsArchive
08-02-2010, 01:54 PM
Hi Jeff,

> Set a flag where the code would only get touched on the final dialog?
>
> So if aborted, it never gets set?

Sure, but the question is where the heck do you put that code to execute...

Best regards,

--
Arnór Baldvinsson - Icetips Alta LLC
Port Angeles, Washington
www.icetips.com - www.buildautomator.com - www.altawebworks.com

Icetips product subscriptions at http://www.icetips.com/subscribe.php

NewsArchive
08-02-2010, 01:54 PM
Arnor,

> Sure, but the question is where the heck do you put that code to execute...

I guess you -could- call an install from inside another install and
use Exit Installation in the called script to determine if it was
cancelled, ie: if NOT cancelled return an exit value.

In the parent you could do your setup and depending on the returned
value from the child install undo it before exiting the parent.

--
Lee White

RPM Report Viewer.: http://www.cwaddons.com/products/rpm/
RPM Review........: http://www.clarionmag.com/cmag/v11/v11n06rpm.html
Report Faxing.....: http://www.cwaddons.com/products/afe/
---Enroll Today---: http://CWaddons.com

Enhanced Reporting: http://www.cpcs-inc.com

NewsArchive
08-02-2010, 01:55 PM
Oh.

MySetup.Destruct<g>

Jeff Slarve

NewsArchive
08-02-2010, 01:55 PM
http://www.lindersoft.com/forums/showthread.php?p=45165

SB Support

NewsArchive
08-02-2010, 01:55 PM
Hi,

> http://www.lindersoft.com/forums/showthread.php?p=45165

Thanks:)

Best regards,

--
Arnór Baldvinsson - Icetips Alta LLC
Port Angeles, Washington
www.icetips.com - www.buildautomator.com - www.altawebworks.com

Icetips product subscriptions at http://www.icetips.com/subscribe.php

NewsArchive
08-04-2010, 02:14 AM
> I guess you -could- call an install from inside another install and

I thought that was a viable workaround. Oh well.<g>

--
Lee White

RPM Report Viewer.: http://www.cwaddons.com/products/rpm/
RPM Review........: http://www.clarionmag.com/cmag/v11/v11n06rpm.html
Report Faxing.....: http://www.cwaddons.com/products/afe/
---Enroll Today---: http://CWaddons.com

Enhanced Reporting: http://www.cpcs-inc.com

NewsArchive
02-07-2019, 04:03 AM
I'm the latest to need this. I create two flag files during the
installation, to tell everyone else to "Get out", then "Stay out" <g>
Unfortunately, if they cancel after either of these have been created,
then the current flag file remains, and no one is able to run the
system (or even restart the installation, because it thinks another is
underway).

I need to execute a task if the user cancels the installation at any
point, so I can clean up any of the marker files that I've created.

Were you ever able to add this feature? I've taken a look through the
help file, but haven't found anything yet.

Mike Hanson
www.boxsoft.net

NewsArchive
02-07-2019, 04:04 AM
Hi Mike,

hmmm, very good point! I'll give it some thoughts.

Friedrich

NewsArchive
02-07-2019, 04:04 AM
Looking forward to your response!

Mike Hanson
www.boxsoft.net

NewsArchive
02-07-2019, 04:04 AM
Just a thought...

Could I just add some logic in the Loop Wizard for the Finish dialog?

Mike Hanson
www.boxsoft.net

NewsArchive
02-07-2019, 04:05 AM
I just tried this: adding a message box within the loop. I see the
Finish dialog, hit the Finish button, but my message never appears. :(

Mike Hanson
www.boxsoft.net

NewsArchive
02-07-2019, 04:05 AM
Mike,

the problem is that a "Cancel" action terminates script processing.

What we need is some kind of a "cancel event", which lets us process a
series of actions (e.g. in form of a "Cancel.sbi" script).

Unfortunately, this is not trivial to do. But it would be cool.

Friedrich

NewsArchive
02-07-2019, 04:05 AM
I understand, but I'm concerned that it's the same answer you gave
someone almost 9 years ago. <g> Given I need a solution sooner rather
than later, how do you recommend I proceed?

For example, I might write a little program, which would be run by the
installer when those files are created (without waiting for its
return). It would hang around watching the running installation
process. Once the installer process disappered, the monitor program
would automatically delete either of those two files that were still
present, and then exit itself. Seems rather kludgy, but it might work.

Mike Hanson
www.boxsoft.net

NewsArchive
02-07-2019, 04:05 AM
Mike,

> For example, I might write a little program, which would be run by the
> installer when those files are created (without waiting for its
> return). It would hang around watching the running installation
> process. Once the installer process disappered, the monitor program
> would automatically delete either of those two files that were still
> present, and then exit itself. Seems rather kludgy, but it might work.

I was going to suggest that. Create a small installer that uses "Run
Program" with "wait" and require your core installer to have a known
command line argument before it does anything - so it cannot be run
standalone.

That last part I do with the server installed for AFE. Without the
proper command line argument it opens a dialog indicating the problem
and then quits.

Your small stub installer could check for the files and remove them
before it quits.

--
Lee White

RPM Report Viewer.: http://www.cwaddons.com/products/rpm/
Report Faxing.....: http://www.cwaddons.com/products/afe/
---Enroll Today---: http://CWaddons.com

Creative Reporting: http://www.CreativeReporting.com

Product Release & Update Notices
http://twitter.com/DeveloperPLUS

NewsArchive
02-07-2019, 04:09 AM
Mike,

> I understand, but I'm concerned that it's the same answer you gave
> someone almost 9 years ago. <g>

I completely understand <g>. I have marked this feature request as
"urgent". I'll keep you posted.

Friedrich

NewsArchive
02-07-2019, 07:24 AM
Mike,

> I understand, but I'm concerned that it's the same answer you gave
> someone almost 9 years ago. <g> Given I need a solution sooner rather
> than later, how do you recommend I proceed?

I have added a new Event. See attached screenshot.

$EVENT:ONCANCEL$ lets you execute functions if the user cancels the
installation at any point in the Wizard Loop(s).

This new feature will be available in the next maintenance build.

What do you think?

Friedrich

NewsArchive
02-07-2019, 07:25 AM
Thanks, Friedrich. I think that will do it. When is the next
Maintenance build due? I've got the support manager leaning on me
pretty heavily, refusing to use the installer until this is fixed. If
it's going to be long, then I may have to create something else in the
interim.

Mike Hanson
www.boxsoft.net

NewsArchive
02-07-2019, 07:26 AM
Mike,

> Thanks, Friedrich. I think that will do it. When is the next
> Maintenance build due? I've got the support manager leaning on me
> pretty heavily, refusing to use the installer until this is fixed. If
> it's going to be long, then I may have to create something else in the
> interim.

The next build is scheduled for February 15, 2019. What's your deadline?

Friedrich

NewsArchive
02-07-2019, 07:27 AM
I think I can write a little cmd file from the installer, then execute
that without waiting. It can scan for the existence of the process,
looping until it's done, then delete those files, and finally itself.
Something like this:

@echo off
:Top
tasklist /FI "IMAGENAME eq installer.exe" 2>NUL | find /I /N
"installer.exe">NUL
if "%ERRORLEVEL%"=="0" goto Top
delete InstallingSoon!
delete InstallingNow!

I'm not sure how far back "tasklist" is support, though, and I need to
determine the name of my installer EXE from within that EXE. I'm not
sure yet how to do that.

I would much rather use Friedrich's new event, so I'm hoping it will
be released soon.

Mike Hanson
www.boxsoft.net

NewsArchive
02-07-2019, 07:27 AM
Mike,

> I would much rather use Friedrich's new event, so I'm hoping it will
> be released soon.

If your deadline is before Friday, February 15 then I can compile and send
you a Build 6156 pre-release.

Friedrich

NewsArchive
02-08-2019, 09:23 AM
If you could, please do. They're quite eager to get this out the door.
(They first mentioned the related symptom back in December, and it
wasn't until yesterday that we happened upon the cause.)

Mike Hanson
www.boxsoft.net

NewsArchive
02-08-2019, 09:23 AM
Hi Mike,

> If you could, please do. They're quite eager to get this out the door.
> (They first mentioned the related symptom back in December, and it
> wasn't until yesterday that we happened upon the cause.)

Absolutely no problem. I'll send you the download link within the next 15
hours. I have tested tons of scripts and the new event seems to work as
expected.

Thanks for bringing this very useful feature back to my attention.

Friedrich

NewsArchive
02-08-2019, 09:23 AM
Thank-you, Friedrich. I don't generally like to be a "squeeky wheel",
but I guess sometimes that's helpful. ;)

Mike Hanson
www.boxsoft.net

NewsArchive
02-08-2019, 09:24 AM
> "squeeky wheel"

Lee White

NewsArchive
02-08-2019, 09:25 AM
Hi Mike,

> Thank-you, Friedrich. I don't generally like to be a "squeeky wheel",
> but I guess sometimes that's helpful. ;)

I sent the pre-release download link one minute ago.

Please let me know if this works for you.

Friedrich

NewsArchive
02-08-2019, 09:25 AM
That works perfectly! Thanks, Friedrich.

Mike Hanson
www.boxsoft.net

NewsArchive
02-09-2019, 03:11 AM
> That works perfectly! Thanks, Friedrich.

Thank you so much, Mike !!!

Friedrich

NewsArchive
03-19-2019, 09:38 AM
Hi Mike,

> That works perfectly! Thanks, Friedrich.

FYI: in the final 2019.2 version, please mark the "Enable EVENT:ONCANCEL"
checkbox in the "Loop Wizard". The runtime only fires the event if this
option is enabled.

Friedrich

NewsArchive
03-20-2019, 01:58 PM
Thanks for the heads-up. I'll keep this in mind.

Mike Hanson
www.boxsoft.net