Compiling Perl scripts to .exe

12 views
Skip to first unread message

Joe Emenaker

unread,
Jul 29, 2010, 6:34:55 PM7/29/10
to Teridon's iTunes Programs
So, I came across Teridon's iTunes scripts yesterday and was blown
away. I didn't know you could do all of that COM control of iTunes
from Perl.

However, my sister and I have a slightly different need from the ones
addressed by the provided scripts.

What I wanted was a script which would go through all of a playlist,
find all of the ones lacking album artwork, and either: 1) get that
artwork from *another* song from the same album in the playlist, or 2)
Notify the user to get album artwork for that song.

You see, when you add album artwork to a song in iTunes, it doesn't
get added to all of the other songs from that album (which I guess is
the right way). But it's not obvious that that's the way it works
because iTunes is clever enough to show the right album in CoverFlow.
If you select a song without artwork, and iTunes is able to find
another song from that same album which *does* have artwork, it'll
show that artwork in CoverFlow. But it *won't* show it in the lower-
left artwork pane. The lower-left pane is your only clue that
something is amiss.

But that makes it tough to find missing artwork. I used to just leaf
through CoverFlow, looking for missing covers. But, like I said, if
just *one* song from the album has artwork, then CoverFlow will look
fine. So, now, to really check, you'd need to click through *every*
song in your library and check the lower-left artwork pane.

And, even if you *found* them, you'd have to drag in artwork for each
of those songs.

So, I altered one of Teridon's scripts to go through any playlist and
find all of the songs without artwork and, if possible, get the
artwork from another song on the same album. Worked like a charm! Now,
I think *every* song in my music library has artwork.

NOW, the problem is... I want to send it to my sister. But she doesn't
have Perl installed on her machine and I don't want her to have to. I
wanted to compile the script to an .exe like Teridon did, but I'm
having issues. I tried the Perl2Exe program, but the .exe that it
creates complains about missing the Data::Dumper library. And I looked
into PAM-Packer on CPAN, but it seems to require a bunch of other
stuff (like nmake and VC++) which I don't want to have to install.

Does anybody know what Teridon uses to compile his perl scripts to
exe's?

ter...@gmail.com

unread,
Jul 30, 2010, 8:30:40 AM7/30/10
to Teridon's iTunes Programs

Joe,

I use 'par' to compile my scripts to an executable.

I don't have my compilation batch file in front of me at the moment,
and I can't remember what I put in there anymore. It's to the point I
just double-click the batch file, so I've forgotten what I put in
there. I can provide that later if you can't figure it out.

IIRC, you just have to install par, (use ppm to install if using
ActivePerl). I think you have to tell par to include Win32::OLE via a
command-line switch.

--
Rob (aka Teridon)

ter...@gmail.com

unread,
Aug 1, 2010, 11:17:57 AM8/1/10
to Teridon's iTunes Programs, joe.em...@gmail.com

Here are the command from my compilation batch file:

cd src
cmd /K "pp --icon gear.ico -o ..\bin\itunes_scripts.exe
itunes_scripts.pl"

As you can see, it's very simple, nothing fancy. I was wrong about
having to include Win32::OLE.

For compiling the GUI, I use this:

cd src
"C:\Program Files\AutoIt3\Aut2Exe\Aut2exe.exe" /in
teridons_itunes_GUI.au3 /out ..\teridons_itunes_scripts.exe /icon
gear.ico

Joe Emenaker

unread,
Aug 2, 2010, 2:50:47 PM8/2/10
to Teridon's iTunes Programs


On Jul 30, 5:30 am, "teri...@gmail.com" <teri...@gmail.com> wrote:
> Joe,
>
> I use 'par' to compile my scripts to an executable.
>
> I don't have my compilation batch file in front of me at the moment,
> and I can't remember what I put in there anymore. It's to the point I
> just double-click the batch file, so I've forgotten what I put in
> there. I can provide that later if you can't figure it out.

The problem seems to be that they've split the PAR package. PAR now
just contains the pure-perl stuff, and PAR-Packer supposedly contains
the stuff involving OS-specific stuff (like the stubs for making
native OSX, linux, and Wintel binaries).

PAR is available through PPM on ActivePerl, but it doesn't contain the
"pp" compiler thing... that's in PAR-Packer, and that's not listed in
the package list in the PPM installer tool.

Hmmmm. Stuck. I'll keep looking for anything "pp.*" on my drive.

ter...@gmail.com

unread,
Aug 2, 2010, 4:07:40 PM8/2/10
to Teridon's iTunes Programs

Ugh. I wasn't aware of these developments! I'm still using an older
version of ActivePerl (5.8.something), which I guess had "pp"
available.

The ActiveState page for PAR-Packer shows that it won't build. See:

http://ppm4.activestate.com/idx/P2...PA.html

I'll see if I can figure out what I did to get mine working.
Reply all
Reply to author
Forward
0 new messages