Quantcast

Perl Script on initialization

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Perl Script on initialization

Dan Muller
Hello All,

I have been fumbling around with execommand custom actions and I just cannot seem to get this to work just right.

I have a perl script that I need to run right before the setup gets to the welcome screen.

my best attempt is
<Property Id="Check" Value=""/>
<CustomAction Id="RunCheck" ExeCommand="perl script/checker.pl" Execute="immediate" Property="Check"/>
but that does nothing.

Does a CA like this need to be explicitly called, or does it just execute?

Thanks for any help,
Dan
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Perl Script on initialization

John Cooper-2
It needs to be schedule in the InstallExecute Sequence or nothing will happen.

This command line might work better for you to:

"[%ComSpec] /C start perl.exe script/checker.pl"

(although the start is probably optional, passing perl off to a command shell would be good unless you know that *.PL is registered with Windows Shell).

--
John Merryweather Cooper
Build & Install Engineer - ESA
Jack Henry & Associates, Inc.(r)
Shawnee Mission, KS  66227
Office:  913-341-3434 x791011
[hidden email]
www.jackhenry.com



-----Original Message-----
From: Dmuller720 [mailto:[hidden email]]
Sent: Tuesday, May 29, 2012 2:15 PM
To: [hidden email]
Subject: [WiX-users] Perl Script on initialization

Hello All,

I have been fumbling around with execommand custom actions and I just cannot seem to get this to work just right.

I have a perl script that I need to run right before the setup gets to the welcome screen.

my best attempt is
<Property Id="Check" Value=""/>
<CustomAction Id="RunCheck" ExeCommand="perl script/checker.pl"
Execute="immediate" Property="Check"/>
but that does nothing.

Does a CA like this need to be explicitly called, or does it just execute?

Thanks for any help,
Dan

--
View this message in context: http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Perl-Script-on-initialization-tp7578584.html
Sent from the wix-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
NOTICE: This electronic mail message and any files transmitted with it are intended
exclusively for the individual or entity to which it is addressed. The message,
together with any attachment, may contain confidential and/or privileged information.
Any unauthorized review, use, printing, saving, copying, disclosure or distribution
is strictly prohibited. If you have received this message in error, please
immediately advise the sender by reply email and delete all copies.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Perl Script on initialization

Dan Muller
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Perl Script on initialization

Dan Muller
I think I have it correct, but it does not seem to be running.

<Property Id="Check" Value=" "/>
<CustomAction Id="RunCheck" ExeCommand="[%ComSpec] /C start perl.exe script/checker.pl" Execute="immediate" Property="Check"/>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Perl Script on initialization

John Cooper-2
Do you have an entry in the InstallExecute Sequence?  Something like:

<InstallExecuteSequence>
        <Custom Action="RunCheck" Before="InstallFinalize" />
</InstallExecuteSequence>

--
John Merryweather Cooper
Build & Install Engineer - ESA
Jack Henry & Associates, Inc.(r)
Shawnee Mission, KS  66227
Office:  913-341-3434 x791011
[hidden email]
www.jackhenry.com




-----Original Message-----
From: Dmuller720 [mailto:[hidden email]]
Sent: Wednesday, May 30, 2012 8:57 AM
To: [hidden email]
Subject: Re: [WiX-users] Perl Script on initialization

I think I have it correct, but it does not seem to be running.

<Property Id="Check" Value=" "/>
<CustomAction Id="RunCheck" ExeCommand="[%ComSpec] /C start perl.exe script/checker.pl" Execute="immediate" Property="Check"/>



--
View this message in context: http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Perl-Script-on-initialization-tp7578584p7578600.html
Sent from the wix-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
NOTICE: This electronic mail message and any files transmitted with it are intended
exclusively for the individual or entity to which it is addressed. The message,
together with any attachment, may contain confidential and/or privileged information.
Any unauthorized review, use, printing, saving, copying, disclosure or distribution
is strictly prohibited. If you have received this message in error, please
immediately advise the sender by reply email and delete all copies.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Perl Script on initialization

Dan Muller
Yes I do,
<InstallExecuteSequence>
        <FindRelatedProducts Sequence="100" />
        <AppSearch After="FindRelatedProducts" />
        <LaunchConditions After="AppSearch" />
        <Custom Action="RunCheck" Before="InstallInitialize" />
        <RemoveExistingProducts After="InstallInitialize" />
</InstallExecuteSequence>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Perl Script on initialization

John Cooper-2
Is perl.exe in your path?  You may need an absolute path to it if it isn't.  After an install, can you run that perl command line from the INSTALLLOCATION directory?  What shows up in the verbose log of the install?

--
John Merryweather Cooper
Build & Install Engineer - ESA
Jack Henry & Associates, Inc.(r)
Shawnee Mission, KS  66227
Office:  913-341-3434 x791011
[hidden email]
www.jackhenry.com




-----Original Message-----
From: Dmuller720 [mailto:[hidden email]]
Sent: Wednesday, May 30, 2012 9:33 AM
To: [hidden email]
Subject: Re: [WiX-users] Perl Script on initialization

Yes I do,
<InstallExecuteSequence>
        <FindRelatedProducts Sequence="100" />
        <AppSearch After="FindRelatedProducts" />
        <LaunchConditions After="AppSearch" />
        <Custom Action="RunCheck" Before="InstallInitialize" />
        <RemoveExistingProducts After="InstallInitialize" /> </InstallExecuteSequence>

--
View this message in context: http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Perl-Script-on-initialization-tp7578584p7578603.html
Sent from the wix-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
NOTICE: This electronic mail message and any files transmitted with it are intended
exclusively for the individual or entity to which it is addressed. The message,
together with any attachment, may contain confidential and/or privileged information.
Any unauthorized review, use, printing, saving, copying, disclosure or distribution
is strictly prohibited. If you have received this message in error, please
immediately advise the sender by reply email and delete all copies.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Perl Script on initialization

Dan Muller
yes, perl is in my path, but I do not think that it is a problem with perl, I think that it is something that I am not doing right in Wix.

So me and my team have sort of refocused and we are at the moment, just trying to make wix open notepad.exe after AppSearch.

...
        <Property Id="QtExecCmdLine" Value="dir > foo.txt"/>
            <CustomAction Id="QtExecExample" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="immediate" Return="check"/>
        </Product>
        <Fragment>
            <InstallExecuteSequence>
                 <Custom Action="QtExecExample" After="AppSearch"/>
            </InstallExecuteSequence>
        </Fragment>
...

Are we on the right track?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Perl Script on initialization

Edwin G. Castro
In reply to this post by John Cooper-2
The Id of the property with the command line needs to match the Id of the custom action you are executing. Also, I don't think CAQuietExec how to execute non-executable files. In my experience you need to provide the executable to execute first _in quotes_ before any arguments you want to pass to the executable.

In the case of opening a file in notepad you would want to use something like this:

<SetProperty Id="QtExecExample" Value="&quot;[SystemFolder]\notepad.exe&quot; [DirectoryId]\foo.txt" Before="QtExecExample"/>
<CustomAction Id="QtExecExample" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="immediate" Return="check"/>
<InstallExecuteSequence>
    <Custom Action="QtExecExample" After="AppSearch"/>
</InstallExecuteSequence>

The above is just an example, you'll need to change SetProperty/@Value to what you need. I think Directory Ids and File Ids are not available until later in the sequence but I forget the specific action that needs to complete before they resolve correctly.

You'll want to look at the documentation for <SetProperty/> to learn more about it. It schedules a custom action to set the QtExecExample property that will contain the command line to execute.

I think you'll need to use AppSearch to find the perl executable and then use <SetProperty/> to set the command line using the perl executable to execute your script.

Edwin G. Castro
Software Developer - Staff
Digital Channels
Fiserv
Office: 503-746-0643
Fax: 503-617-0291
www.fiserv.com
Please consider the environment before printing this e-mail


> -----Original Message-----
> From: Dmuller720 [mailto:[hidden email]]
> Sent: Friday, June 08, 2012 7:35 AM
> To: [hidden email]
> Subject: Re: [WiX-users] Perl Script on initialization
>
> yes, perl is in my path, but I do not think that it is a problem with perl, I think
> that it is something that I am not doing right in Wix.
>
> So me and my team have sort of refocused and we are at the moment, just
> trying to make wix open notepad.exe after AppSearch.
>
> ...
>         <Property Id="QtExecCmdLine" Value="dir > foo.txt"/>
>             <CustomAction Id="QtExecExample" BinaryKey="WixCA"
> DllEntry="CAQuietExec" Execute="immediate" Return="check"/>
>         </Product>
>         <Fragment>
>             <InstallExecuteSequence>
>                  <Custom Action="QtExecExample" After="AppSearch"/>
>             </InstallExecuteSequence>
>         </Fragment>
> ...
>
> Are we on the right track?
>
>
> --
> View this message in context: http://windows-installer-xml-wix-
> toolset.687559.n2.nabble.com/Perl-Script-on-initialization-
> tp7578584p7578740.html
> Sent from the wix-users mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and threat
> landscape has changed and how IT managers can respond. Discussions will
> include endpoint security, mobile security and the latest in malware threats.
> http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> WiX-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Perl Script on initialization **UPDATE**

Dan Muller
Thank you for your help! We eventually figured it out, here is a snippet of our working source
                <Binary
                        Id="ExecuteCommand"
                        SourceFile="path\to\exe\ExecuteCommand.exe" />
               
                <CustomAction
                        Id="checkDependencies"
                        BinaryKey="ExecuteCommand"
                        Impersonate="yes"
                        Execute="deferred"
                        ExeCommand="perl 'checkDependencies.pl'"
                        Return="check" />
We had to write our own exe to do it however, but that was not really a problem.

Now we are trying to figure out how we can get the perl scripts into the msi, unpacked and on the new system, and run them before install. Is there a way to include the .pl files and our ExecuteCommand.exe in the msi like you would normal components and write them before the other files, or to include them a separate way and have them still be written to disk before the actual install occurs.

Thanks again,
Dan
Loading...