Automatic program path detection
This commit is contained in:
parent
1957b9f56c
commit
1f402a5055
|
@ -111,7 +111,7 @@ sub new {
|
||||||
# initialize main window
|
# initialize main window
|
||||||
$self->{'mw'} = Gtk2::Window->new("toplevel");
|
$self->{'mw'} = Gtk2::Window->new("toplevel");
|
||||||
$self->{'mw'}->set_title("TinyCA2 Management $self->{'version'}");
|
$self->{'mw'}->set_title("TinyCA2 Management $self->{'version'}");
|
||||||
$self->{'mw'}->set_icon_from_file("./icons/tinyca.png");
|
$self->{'mw'}->set_icon_from_file($self->{'init'}->{'progdir'}."/icons/tinyca.png");
|
||||||
|
|
||||||
$self->{'mw'}->set_resizable(1);
|
$self->{'mw'}->set_resizable(1);
|
||||||
$section = $self->{'init'}->{'cfg'}->{window};
|
$section = $self->{'init'}->{'cfg'}->{window};
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
[global]
|
||||||
|
debug = false
|
||||||
|
|
||||||
[paths]
|
[paths]
|
||||||
basedir = /var/lib/tinyca
|
basedir = /var/lib/tinyca
|
||||||
exportdir = /tmp
|
exportdir = /tmp
|
||||||
|
|
9
tinyca2
9
tinyca2
|
@ -29,6 +29,7 @@ use MIME::Base64;
|
||||||
|
|
||||||
use POSIX;
|
use POSIX;
|
||||||
use Locale::gettext;
|
use Locale::gettext;
|
||||||
|
use File::Basename;
|
||||||
|
|
||||||
use OpenSSL;
|
use OpenSSL;
|
||||||
use CA;
|
use CA;
|
||||||
|
@ -45,15 +46,17 @@ use REQ;
|
||||||
use KEY;
|
use KEY;
|
||||||
use TCONFIG;
|
use TCONFIG;
|
||||||
|
|
||||||
|
my $init = {};
|
||||||
|
$init->{'progdir'} = dirname($0);
|
||||||
|
|
||||||
setlocale(LC_MESSAGES, "");
|
setlocale(LC_MESSAGES, "");
|
||||||
bindtextdomain("tinyca2", "./locale/");
|
bindtextdomain("tinyca2", $init->{'progdir'}."/locale/");
|
||||||
textdomain("tinyca2");
|
textdomain("tinyca2");
|
||||||
|
|
||||||
# https://bugs.gentoo.org/show_bug.cgi?id=78576
|
# https://bugs.gentoo.org/show_bug.cgi?id=78576
|
||||||
$ENV{XLIB_SKIP_ARGB_VISUALS}= '1';
|
$ENV{XLIB_SKIP_ARGB_VISUALS}= '1';
|
||||||
|
|
||||||
my $cfg = HELPERS::read_global_cfg();
|
my $cfg = HELPERS::read_global_cfg();
|
||||||
my $init = {};
|
|
||||||
|
|
||||||
# location of openssl
|
# location of openssl
|
||||||
$init->{'opensslbin'} = $cfg->{paths}{opensslbin} // "/usr/bin/openssl";
|
$init->{'opensslbin'} = $cfg->{paths}{opensslbin} // "/usr/bin/openssl";
|
||||||
|
@ -77,7 +80,7 @@ if(not -x $init->{'tarbin'}) {
|
||||||
}
|
}
|
||||||
|
|
||||||
# directory with the templates
|
# directory with the templates
|
||||||
$init->{'templatedir'} = $cfg->{paths}{templatedir} // "./templates";
|
$init->{'templatedir'} = $cfg->{paths}{templatedir} // $init->{'progdir'}."/templates";
|
||||||
|
|
||||||
if(not -d $init->{'templatedir'}) {
|
if(not -d $init->{'templatedir'}) {
|
||||||
print gettext("Can't find templatedir.\n");
|
print gettext("Can't find templatedir.\n");
|
||||||
|
|
Loading…
Reference in New Issue