PC Review


Reply
Thread Tools Rate Thread

cancel the uninstaller after a deferred custom action

 
 
Viviana Vc
Guest
Posts: n/a
 
      24th Nov 2005
Hi all,

I have a deferred custom action that has to show a UI to the user and
then the custom action takes action depending on what the user has
selected. That UI has a Cancel. If the user choses this Cancel I would
like right away to abort the uninstaller. So I have to abort the
uninstaller as soon as the custom action returned a specific value. Is
this somehow possible?

If it's of any help I am using InstallShield Premier 11.

Thanks,
Viv
 
Reply With Quote
 
 
 
 
Rob Hamflett
Guest
Posts: n/a
 
      24th Nov 2005
You can disable rollback (not sure how in InstallShield), but it's really not advised. You could
leave your machine in an unknown state.

Rob

Viviana Vc wrote:
> Hi all,
>
> I have a deferred custom action that has to show a UI to the user and
> then the custom action takes action depending on what the user has
> selected. That UI has a Cancel. If the user choses this Cancel I would
> like right away to abort the uninstaller. So I have to abort the
> uninstaller as soon as the custom action returned a specific value. Is
> this somehow possible?
>
> If it's of any help I am using InstallShield Premier 11.
>
> Thanks,
> Viv

 
Reply With Quote
 
Viviana Vc
Guest
Posts: n/a
 
      25th Nov 2005
Hi Rob,

Thx for you answer. Actually my problem is not the rollback. Let's say
that I have a custom action that in some cases needs to make the
uninstaller to stop simulating the same behaviour like the user pressed
Cancel, so rollback should be run. So let's say if my exe returns -1 the
uninstaller should react like the user has chosen cancel on the MSI
dialog.

I thought about returning from that exe a value diff than 0 let's say -1
for the cases when I want the uninstaller to be canceled, but then I get
the dialog: "Error 1722. There is a problem with Windows Installer
package. a program run as part of the setup did not finish as expected.
Contact your support personnel or package vendor". After that the
rollback is done and the "Wizard was interrupted ..." dialog is shown.
The only thing I would want to change in this behaviour is that the
dialog with "Error 1722: ..." not to be shown.

Or any other suggestion on how could I do this: in some cases after I
run the custom action I want the uninstaller to abort exactly as it
would do when the user presses cancel". Is this possible?

Thx,
Viv

On Thu, 24 Nov 2005 16:37:18 +0000, Rob Hamflett <(E-Mail Removed)> wrote :

>You can disable rollback (not sure how in InstallShield), but it's really not advised. You could
>leave your machine in an unknown state.
>
>Rob
>
>Viviana Vc wrote:
>> Hi all,
>>
>> I have a deferred custom action that has to show a UI to the user and
>> then the custom action takes action depending on what the user has
>> selected. That UI has a Cancel. If the user choses this Cancel I would
>> like right away to abort the uninstaller. So I have to abort the
>> uninstaller as soon as the custom action returned a specific value. Is
>> this somehow possible?
>>
>> If it's of any help I am using InstallShield Premier 11.
>>
>> Thanks,
>> Viv


 
Reply With Quote
 
Kalle Olavi Niemitalo
Guest
Posts: n/a
 
      26th Nov 2005
Viviana Vc <(E-Mail Removed)> writes:

> Thx for you answer. Actually my problem is not the rollback. Let's say
> that I have a custom action that in some cases needs to make the
> uninstaller to stop simulating the same behaviour like the user pressed
> Cancel, so rollback should be run. So let's say if my exe returns -1 the
> uninstaller should react like the user has chosen cancel on the MSI
> dialog.


You cannot do this with an EXE custom action.
In a DLL custom action [1], return ERROR_INSTALL_USEREXIT = 1602.
In a script custom action [2], return IDCANCEL = 2.

References:

[1] Custom Action Return Values [Windows Installer]
http://msdn.microsoft.com/library/en...urn_values.asp

[2] Return Values of JScript and VBScript Custom Actions [Windows Installer]
http://msdn.microsoft.com/library/en...om_actions.asp
 
Reply With Quote
 
Johan Johansson
Guest
Posts: n/a
 
      26th Nov 2005
Viviana Vc wrote:

> I have a deferred custom action that has to show a UI to the user and
> then the custom action takes action depending on what the user has
> selected.


Why can't you do it in your UI sequence?

Johan
 
Reply With Quote
 
Viviana Vc
Guest
Posts: n/a
 
      28th Nov 2005
Thanks for your answer. I'll give it a try.

Viv

On Sat, 26 Nov 2005 10:49:51 +0200, Kalle Olavi Niemitalo <(E-Mail Removed)>
wrote :

>Viviana Vc <(E-Mail Removed)> writes:
>
>> Thx for you answer. Actually my problem is not the rollback. Let's say
>> that I have a custom action that in some cases needs to make the
>> uninstaller to stop simulating the same behaviour like the user pressed
>> Cancel, so rollback should be run. So let's say if my exe returns -1 the
>> uninstaller should react like the user has chosen cancel on the MSI
>> dialog.

>
>You cannot do this with an EXE custom action.
>In a DLL custom action [1], return ERROR_INSTALL_USEREXIT = 1602.
>In a script custom action [2], return IDCANCEL = 2.
>
>References:
>
>[1] Custom Action Return Values [Windows Installer]
>http://msdn.microsoft.com/library/en...urn_values.asp
>
>[2] Return Values of JScript and VBScript Custom Actions [Windows Installer]
>http://msdn.microsoft.com/library/en...om_actions.asp


 
Reply With Quote
 
Viviana Vc
Guest
Posts: n/a
 
      28th Nov 2005
AFAIK, all the custom action that are defined in the UI secquence are
skiped if the (un)installer is run in silent mode. I need to run my
custom action so I need to have it in the execute sequence.

Then my custom action needs to talk to the server for some things and if
this communication fails I am asking the user if he wants to continue or
to abort the uninstaller. So I need at this point to show him an UI.

Viv

On Sat, 26 Nov 2005 14:20:40 +0100, Johan Johansson
<(E-Mail Removed)> wrote :

>Viviana Vc wrote:
>
>> I have a deferred custom action that has to show a UI to the user and
>> then the custom action takes action depending on what the user has
>> selected.

>
>Why can't you do it in your UI sequence?
>
>Johan


 
Reply With Quote
 
Viviana Vc
Guest
Posts: n/a
 
      28th Nov 2005
Taking in account your suggestion can I do the following?:
- run my exe and this exe will set a specific MSI property in case
cancel was selected
- add a new VBScript custom action that will be executed right after the
above one
- this one checks that property and in case it was cancel it will return
IDCANCEL=2
Would something like this be ok?

Or creating a VBSCript CA that itself runs my exe (this is available on
the target system) and checks the return value and if it was cancel it
will itself return IDCANCEL=2?

Thanks,
Viv


On Sat, 26 Nov 2005 10:49:51 +0200, Kalle Olavi Niemitalo <(E-Mail Removed)>
wrote :

>Viviana Vc <(E-Mail Removed)> writes:
>
>> Thx for you answer. Actually my problem is not the rollback. Let's say
>> that I have a custom action that in some cases needs to make the
>> uninstaller to stop simulating the same behaviour like the user pressed
>> Cancel, so rollback should be run. So let's say if my exe returns -1 the
>> uninstaller should react like the user has chosen cancel on the MSI
>> dialog.

>
>You cannot do this with an EXE custom action.
>In a DLL custom action [1], return ERROR_INSTALL_USEREXIT = 1602.
>In a script custom action [2], return IDCANCEL = 2.
>
>References:
>
>[1] Custom Action Return Values [Windows Installer]
>http://msdn.microsoft.com/library/en...urn_values.asp
>
>[2] Return Values of JScript and VBScript Custom Actions [Windows Installer]
>http://msdn.microsoft.com/library/en...om_actions.asp


 
Reply With Quote
 
Kalle Olavi Niemitalo
Guest
Posts: n/a
 
      28th Nov 2005
Viviana Vc <(E-Mail Removed)> writes:

> Taking in account your suggestion can I do the following?:
> - run my exe and this exe will set a specific MSI property in case
> cancel was selected


No, you can't do that, at least not easily. To set a property,
you'd have to call MsiSetProperty, but it requires a MSIHANDLE
parameter, which you cannot get to the process running the exe.

(There probably are sneaky ways around this, e.g. by making the
exe attach itself as a debugger to the process that started it,
but a DLL custom action will certainly be easier.)

> Or creating a VBSCript CA that itself runs my exe (this is available on
> the target system) and checks the return value and if it was cancel it
> will itself return IDCANCEL=2?


This sounds doable. However, I recall reading a horror story
about an anti-virus program that blocked all scripts, including
script custom actions. If you suspect your customers may be
using such things, a DLL custom action may be more reliable.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Uninstaller and App Manager Neville Lang Microsoft Dot NET Compact Framework 5 17th Jan 2006 12:25 AM
Getting "Deferred action folder could not be found" error.. =?Utf-8?B?U3VuZGFyIFJhZ2hhdmFu?= Microsoft Outlook Discussion 3 21st Aug 2005 11:49 AM
Deferred action folder =?Utf-8?B?U2NvdHQgRGV2ZXI=?= Microsoft Outlook Discussion 1 16th Jun 2005 02:06 AM
Cancel action an Microsoft Access Forms 2 9th Sep 2004 04:47 PM
any way for deferred custom action to tell where the heck he is? EP Microsoft Windows 2000 MSI 1 9th Dec 2003 09:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:46 AM.