PAR-Packer

 view release on metacpan or  search on metacpan

script/tkpp  view on Meta::CPAN

my $REPEAT_FILE_TIME = 2000;
my $EMPTY            = q{};
my $DOUBLE_QUOTE     = '"';
my $SIMPLE_QUOTE     = "'";
my $SPACE            = q{ };

my %EXIT_WINDOWS_STATUS = (
	'1'   => 'miscellaneous errors, maybe the process is stopped.',
	'5'   => 'Access is denied.',
	'25'  => 'The drive cannot locate a specific area or track on the disk.',
	'26'  => 'The specified disk or diskette cannot be accessed.',
	'126' => 'Permission problem or command is not an executable.',
	'127' => 'The specified procedure could not be found, possible problem with $PATH or a typo.',
	'128' => 'There are no child processes to wait for.',
	'255' => 'The extended attributes are inconsistent.',
);

my %ALL_STATUS = (
	ready    => 'Ready',
	building => 'Building...',
	error    => 'Finished with errors... See output',
	finished => 'Finished... See output... Ready',
);

my %FILTERS_MODULES = (
	Obfuscate => 'B::Deobfuscate',
	Crypto    => 'Filter::Crypto',
);

my $status       = $ALL_STATUS{ready};
my $homedir      = $ENV{USERPROFILE} || $ENV{HOME};
my $current_dir  = $homedir;
my $last_filedir = File::Spec->catfile( $homedir, 'tkpp.tmp' );
if ( -e $last_filedir ) {
	open my $fh, '<', $last_filedir or die "Unable to read $last_filedir\n";
	$current_dir = <$fh>;
	close $fh or die "Unable to close $last_filedir\n";
}
else {
	open my $fh, '>', $last_filedir or die "Unable to read $last_filedir\n";
	print {$fh} $current_dir;
	close $fh or die "Unable to close $last_filedir\n";
}

# Process_buiding
my $win32_process_buiding;

# pp file extension
my $pp_extension = ( $OSNAME eq 'MSWin32' ) ? '.bat' : $EMPTY;

my %general_configuration = (
	authors => {
		DJIBEL   => [ 'Djibril Ousmanou', 'djibel@cpan.org',   'http://search.cpan.org/~djibel/' ],
		DOUGTHUG => [ 'Doug Gruber',      'dougthug@cpan.org', 'http://www.dougthug.com' ],
	},
	perl_path        => $EXECUTABLE_NAME,
	pp_path          => File::Spec->catfile( dirname($PROGRAM_NAME), 'pp' . $pp_extension ),
	log_path         => 'tkpp.log',
	commandline_path => 'tkpp_command.bat',
	tkpp_conf        => 'tkpp_conf.tkpp',
	gpg_path         => undef,
	perl_version     => $PERL_VERSION,
	tk               => {
		name_application => 'Tkpp',
		header_title     => "Tkpp is a GUI frontend to pp, which can turn perl scripts \n"
		  . 'into stand-alone PAR files, perl scripts or executables.',
		title         => 'Tkpp Application',
		about_message => 'Tkpp v'
		  . $VERSION
		  . ' was written by Doug Gruber <dougthug@cpan.org>'
		  . ' and rewrite by Djibril Ousmanou <djibel@cpan.org>',
	},
);
$general_configuration{pp_version} = `$general_configuration{pp_path} -V`;

# Options using to load and save pp GUI configuration
my @pp_default_options = (
	[ 'addfile',     '=s', '',                                           alias => ['a'], ],
	[ 'addlist',     '=s', '',                                           alias => ['A'], ],
	[ 'bundle',      '!',  1,                                            alias => ['B'], ],
	[ 'clean',       '!',  0,                                            alias => ['C'], ],
	[ 'compile',     '!',  0,                                            alias => ['c'], ],
	[ 'cachedeps',   '=s', '',                                           alias => ['cd'], ],
	[ 'dependent',   '!',  0,                                            alias => ['d'], ],
	[ 'eval',        '=s', '',                                           alias => ['e'], ],
	[ 'evalfeature', '=s', '',                                           alias => ['E'], ],
	[ 'execute',     '!',  0,                                            alias => ['x'], ],
	[ 'exclude',     '=s', '',                                           alias => ['X'], ],
	[ 'filter',      '=s', '',                                           alias => ['f'], ],
	[ 'gui',         '!',  0,                                            alias => ['g'], ],
	[ 'help',        '!',  0,                                            alias => ['h'], ],
	[ 'info',        '=s', 'ProductVersion=0.0.0.0;FileVersion=0.0.0.0', alias => ['N'], ],
	[ 'icon',        '=s', '',                                           alias => ['i'], ],
	[ 'lib',         '=s', '', ],
	[ 'link',        '=s', '',                                           alias => ['l'], ],
	[ 'log',         '=s', '',                                           alias => ['L'], ],
	[ 'modfilter',   '=s', '',                                           alias => ['F'], ],
	[ 'module',      '=s', '',                                           alias => ['M'], ],
	[ 'multiarch',   '!',  0,                                            alias => ['m'], ],
	[ 'noscan',      '!',  0,                                            alias => ['n'], ],
	[ 'output',      '=s', '',                                           alias => ['o'], ],
	[ 'par',         '!',  0,                                            alias => ['p'], ],
	[ 'perlscript',  '!',  0,                                            alias => ['P'], ],
	[ 'podstrip',    '!',  0, ],
	[ 'reusable',    '!',  0, ],
	[ 'run',         '!',  0,                                            alias => ['r'], ],
	[ 'save',        '!',  0,                                            alias => ['S'], ],
	[ 'sign',        '!',  0,                                            alias => ['s'], ],
	[ 'tempcache',   '!',  0,                                            alias => ['T'], ],
	[ 'verbose',     '!',  0,                                            alias => ['v'], ],
	[ 'version',     '!',  0,                                            alias => ['V'], ],
	[ 'compress',    '=i', 6,                                            alias => ['z'], ],

	# Special Options
	[ 'sourcefile',       '=s', '', ],
	[ 'perlfile',         '=s', $general_configuration{perl_path}, ],
	[ 'ppfile',           '=s', $general_configuration{pp_path}, ],
	[ 'scandependencies', '=s', 'static', ],
);

# Options using to create and read Tkpp GUI



( run in 0.566 second using v1.01-cache-2.11-cpan-df04353d9ac )