Re: Conditionally require restart
Re: Conditionally require restart
- Subject: Re: Conditionally require restart
- From: Andrew Keller <email@hidden>
- Date: Thu, 11 Oct 2012 16:41:28 -0500
On Oct 11, 2012, at 2:19 AM, Stephane Sudre wrote:
> On Thu, Oct 11, 2012 at 1:24 AM, Andrew Keller <email@hidden> wrote:
>> Hello all,
>>
>> Is it possible to conditionally require a restart for an install?
>
> Yes.
>
>> Here's my situation:
>>
>> Version 2 of my app cannot be properly unloaded without a shutdown, but version 3 can.
>>
>> So, for a fresh install, nothing exists, so just install the software without a restart. If you are installing 3.0.1 and 3.0.0 is installed, a restart still is not required. But, if you are installing 3.x (or even any version) and 2.x is installed, a restart is required.
>
> Here is how this can be done:
>
> - make a distribution with 2 packages: one for the the payload, one of
> the restart action
>
> - in the payload package, do everything as usual. Do not require a
> restart upon a successful installation.
>
> - in the restart package:
>
> o require a restart upon a successful installation
> o do not install anything
>
> - in the distribution:
>
> o set a requirement for the choice corresponding to the restart package:
>
> unselect the choice when a requirement is not met (for instance a
> file specific to your 2.0 version is installed or you can call a shell
> script to do more advanced stuff that you would not be able to do via
> JavaScript).
Is there an easy way to choose whether to use JavaScript or shell? I need to do approximately this:
kextstat | perl -e 'while (<>) { exit 1 if /com.test.example \([1-2].*\)/; }'
That is, if a kernel extension called com.test.example is loaded, and if it's version 1.x or 2.x, require a restart. Else, do not require a restart.
Thanks,
Andrew Keller
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Installer-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden