Win32-GUI の変更点
PerlでWindows用の単体で配布可能なGUI付きソフトを作ってみる。
**必要なもの
-[[ActivePerl>http://www.activestate.com/Products/ActivePerl/]]
-[[Win32::GUI>http://perso.club-internet.fr/rocherl/Win32GUI.html#WinGui]]
-[[The GUI Loft + Win32::GUI::Loft>http://www.bahnhof.se/~johanl/perl/Loft/]]
-Win32::API
**インストール
+[[ActivePerl>http://www.activestate.com/Products/ActivePerl/]]5.8系をインストール
+再起動 (パスが通るように)
+Win32-GUI-0.99_1-PPM-5.8.zipをc:\に解凍
+Loft_binary.zipをc:\に解凍
+コマンドプロンプト起動 (Win+r, cmd)
+Win32::GUIをインストール
cd \Win32-GUI-0.99_1-PPM-5.8
ppm install Win32-GUI.ppd
cd ..
rmdir /s Win32-GUI-1.0-PPM-5.8
+The GUI Loftをインストール
cd \TheGUILoft\PPM\AdHoc
ppm install Win32-GUI-AdHoc.ppd
cd \TheGUILoft\PPM\Loft
ppm install Win32-GUI-Loft.ppd
+Win32::APIをインストール
ppm install Win32-API
**使ってみる
-\TheGUILoft\tgl.exe で GUIを作成。launcher.gld として保存。
-いやな日記さんのコードを入力。launcher.pl として保存。
-launcher.gld と launcher.pl を同じフォルダに突っ込んで、launcher.pl を実行。
*exeにする
以下が必要
-CPAN
-[[PAR>http://par.perl.org/]]
**CPANをインストール
以下が必要
-http://www.ring.gr.jp/pub/text/TeX/ptex-win32/current/ から texinst754.zip を入手。
--gzip
--tar
-http://support.microsoft.com/default.aspx?scid=kb;en-us;Q132084
--nmake
+上記を解凍して次のものをc:\binにコピー。
--gzip.exe
--tar.exe
--NMAKE.EXE
--NMAKE.ERR
+環境変数にc:\binを加える。
+コマンドプロンプト起動 (Win+r, cmd)
+CPANの初期設定
perl -MCPAN -e shell
Enter連打。gzip,tar,makeの箇所だけは慎重に。
**PARをインストール
適当に解凍
cd \PAR-0.86
perl Makefile.PL
nmake
nmake install
cd ..
rmdir /s PAR-0.86
**exeに変換
pp --gui -a launcher.gld -o launcher.exe launcher.pl
**備考
-Encode.pm使うときはuse Encode::JP;と記述すること。
-ワンライナーもexeに出来る。
pp -o hello -e 'print "hello\n"'
*アイコンを変える
pp -g -i launcher.ico -a launcher.gld -o launcher.exe launcher.pl
でも変えられるが、試したところ一気に数百kByte増えてしまったので、
[[KH IconRewrite98>http://www.khsoft.gr.jp/software/#iconrewrite98]]を使う。
*出来た!
-[[Windows/Mozilla Thunderbird/Becky2からの移行/振り分け・フィルタ]]
*参考
-[[PAR: Perl のスクリプトを Windows 用の実行ファイル (exe形式) に変換する : いやな日記>http://namazu.org/~satoru/diary/20040716.html]]
-[[Perl で GUI: Win32::GUI と Win32::GUI::Loft を使う : いやな日記>http://www.namazu.org/~satoru/diary/20040717.html#p01]]
-[[Perlモジュール/インストール(CPAN) - ActivePerl+CPANによるモジュールインストール方法。>http://digit.que.ne.jp/work/index.cgi?Perl%A5%E2%A5%B8%A5%E5%A1%BC%A5%EB%2F%A5%A4%A5%F3%A5%B9%A5%C8%A1%BC%A5%EB(CPAN)]]
-[[Documentation For The Win32::GUI Packages - The Win32::GUI Documentation Project>http://jeb.ca/perl/win32-gui-docs/index.pl/win32-gui-packages]]
-[[レジストリ値の取得>http://www2u.biglobe.ne.jp/~MAS/perl/waza/regget.html]]
*Amazon
#amazon(4873111269,left)
#amazon(4873111676,left)
#amazon(4883374068,left)
#amazon(4839907501,left)