use File::Path qw(make_path remove_tree);
use Data::Dumper;
my $tag="";
-my $showtags = 0;
-my $setup = "director";
-GetOptions("tag|t=s" => \$tag, "showtags|s" => \$showtags,"version|v=s" => \$setup);
+#my $showtags = 0;
+my $setup = "";
+#GetOptions("tag|t=s" => \$tag, "showtags|s" => \$showtags,"version|v=s" => \$setup);
-chdir "C:\\Users\\ksaff\\Workspace\\Creorga";
+chdir "C:\\Users\\ksaff\\Workspace\\creorga";
my $strtags = `"C:\\Program Files\\Git\\bin\\git.exe" for-each-ref --sort=-creatordate --format="%(refname)" refs/tags`;
+my @modes = ("director","staff","localmanger");
+print "Select Mode:\n";
+for (my $m=0;$m<scalar(@modes);$m++){
+ print $m.": ".$modes[$m]."\n";
+}
+print "Mode:";
+my $ms = <STDIN>;
+chomp($ms);
+$setup = $modes[$ms];
+print "Mode selected:".$modes[$ms]."!\n";
+
my @tags = split("\n",$strtags);
my @tex = grep(/^refs\/tags\/$tag$/,@tags);
-if ($showtags == 1) {
+#if ($showtags == 1) {
foreach my $t (reverse(@tags)){
print $t."\n";
}
- exit(0);
-}
+# exit(0);
+#}
+$tag = <STDIN>;
+chomp($tag);
+print "Compiling Creorga".$setup." version ".$tag."\n";
+
+exit(0);
remove_tree("C:\\Users\\ksaff\\Release",{keep_root => 1});
if (scalar(@tex) > 0) {
print "Tag $tag exists!\n";
}else {
print "Tag $tag does not exist!\n";
- chdir "C:\\Users\\ksaff\\Workspace\\Creorga\\Creorga";
+ chdir "C:\\Users\\ksaff\\Workspace\\creorga\\Creorga";
system('"C:\\Program Files\\Git\\bin\\git.exe" tag '.$tag.' -m "Version '.$tag.'";');
}
system('"C:\\Program Files\\Git\\bin\\git.exe" archive -o "C:\\Users\\ksaff\\Release\\Creorga_'.$tag.'.zip" '.$tag.'');
system('"C:\\Tools\\7za.exe" x "C:\\Users\\ksaff\\Release\\Creorga_'.$tag.'.zip"');
-chdir "C:\\Users\\ksaff\\Release\\tag\\app";
+chdir "C:\\Users\\ksaff\\Release\\tag\\app_v3";
if ($setup eq "director"){
my @unused_files = File::Find::Rule->file()
->name( qr/.+_basic.*/ )
- ->in("C:\\Users\\ksaff\\Release\\tag\\app");
+ ->in("C:\\Users\\ksaff\\Release\\tag\\app_v3");
foreach my $a (@unused_files){
print "unlink $a\n";
unlink($a);
}
@unused_files = File::Find::Rule->file()
->name( qr/.+_free.*/ )
- ->in("C:\\Users\\ksaff\\Release\\tag\\app");
+ ->in("C:\\Users\\ksaff\\Release\\tag\\app_v3");
foreach my $a (@unused_files){
print "unlink $a\n";
unlink($a);
}
- remove_tree("C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\modules\\staff_basic");
- remove_tree("C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\modules\\default_free");
+ remove_tree("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\staff_basic");
+ remove_tree("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\default_free");
} elsif ($setup eq "staff"){
my @unused_files = File::Find::Rule->file()
->name( qr/.+_standard.*/ )
- ->in("C:\\Users\\ksaff\\Release\\tag\\app");
+ ->in("C:\\Users\\ksaff\\Release\\tag\\app_v3");
foreach my $a (@unused_files){
print "unlink $a\n";
unlink($a);
}
my @unused_files = File::Find::Rule->file()
->name( qr/.+_free.*/ )
- ->in("C:\\Users\\ksaff\\Release\\tag\\app");
+ ->in("C:\\Users\\ksaff\\Release\\tag\\app_v3");
foreach my $a (@unused_files){
print "unlink $a\n";
unlink($a);
}
- unlink("C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\modules\\logbook\\logbook.xul");
- unlink("C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\modules\\logbook\\logactivity.html");
- unlink("C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\modules\\logbook\\js\\logactivity.js");
- remove_tree("C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\modules\\default_standard");
- remove_tree("C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\modules\\accounting");
+ unlink("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\logbook\\logbook.xul");
+ unlink("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\logbook\\logactivity.html");
+ unlink("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\logbook\\js\\logactivity.js");
+ remove_tree("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\default_standard");
+ remove_tree("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\accounting");
#remove_tree("C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\modules\\staff");
} elsif ($setup eq "localmanager"){
my @unused_files = File::Find::Rule->file()
->name( qr/.+_standard.*/ )
- ->in("C:\\Users\\ksaff\\Release\\tag\\app");
+ ->in("C:\\Users\\ksaff\\Release\\tag\\app_v3");
foreach my $a (@unused_files){
print "unlink $a\n";
unlink($a);
}
my @unused_files = File::Find::Rule->file()
->name( qr/.+_free.*/ )
- ->in("C:\\Users\\ksaff\\Release\\tag\\app");
+ ->in("C:\\Users\\ksaff\\Release\\tag\\app_v3");
foreach my $a (@unused_files){
print "unlink $a\n";
unlink($a);
}
- unlink("C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\modules\\logbook\\logbook.xul");
- unlink("C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\modules\\logbook\\logactivity.html");
- unlink("C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\modules\\logbook\\js\\logactivity.js");
- remove_tree("C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\modules\\default_standard");
- remove_tree("C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\modules\\accounting");
+ unlink("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\logbook\\logbook.xul");
+ unlink("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\logbook\\logactivity.html");
+ unlink("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\logbook\\js\\logactivity.js");
+ remove_tree("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\default_standard");
+ remove_tree("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\accounting");
#remove_tree("C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\modules\\staff");
} elsif ($setup eq "free"){
my @unused_files = File::Find::Rule->file()
->name( qr/.+_standard.*/ )
- ->in("C:\\Users\\ksaff\\Release\\tag\\app");
+ ->in("C:\\Users\\ksaff\\Release\\tag\\app_v3");
foreach my $a (@unused_files){
print "unlink $a\n";
unlink($a);
}
@unused_files = File::Find::Rule->file()
->name( qr/.+_basic.*/ )
- ->in("C:\\Users\\ksaff\\Release\\tag\\app");
+ ->in("C:\\Users\\ksaff\\Release\\tag\\app_v3");
foreach my $a (@unused_files){
print "unlink $a\n";
unlink($a);
}
@unused_files = File::Find::Rule->file()
->name( qr/logcominterne.*/ )
- ->in("C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\modules\\logbook");
+ ->in("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\logbook");
foreach my $a (@unused_files){
print "unlink $a\n";
unlink($a);
}
- move("C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\js\\init_free.js","C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\js\\init.js");
- move("C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\modules\\staff\\coworker_free.html","C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\modules\\staff\\coworker.html");
- move("C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\creorga_free.xul","C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\creorga.xul");
- unlink("C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\js\\tools.js");
- unlink("C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\js\\encrypt.js");
- unlink("C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\modules\\support\\support.xul");
- unlink("C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\modules\\support\\support.xul");
- unlink("C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\modules\\support\\update.html");
- unlink("C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\modules\\support\\multisite.html");
- unlink("C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\modules\\support\\backup.html");
- unlink("C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\modules\\logbook\\logstaff.html");
+ move("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\js\\init_free.js","C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\js\\init.js");
+ move("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\staff\\coworker_free.html","C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\staff\\coworker.html");
+ move("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\creorga_free.xul","C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\creorga.xul");
+ unlink("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\js\\tools.js");
+ unlink("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\js\\encrypt.js");
+ unlink("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\support\\support.xul");
+ unlink("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\support\\support.xul");
+ unlink("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\support\\update.html");
+ unlink("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\support\\multisite.html");
+ unlink("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\support\\backup.html");
+ unlink("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\logbook\\logstaff.html");
#unlink("C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\modules\\logbook\\logcominterne.html");
- unlink("C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\modules\\logbook\\logchild.html");
- unlink("C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\modules\\logbook\\logbook.xul");
- unlink("C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\modules\\logbook\\logactivity.html");
- unlink("C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\modules\\logbook\\logcominterne.html");
- unlink("C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\modules\\logbook\\js\\logstaff.js");
+ unlink("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\logbook\\logchild.html");
+ unlink("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\logbook\\logbook.xul");
+ unlink("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\logbook\\logactivity.html");
+ unlink("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\logbook\\logcominterne.html");
+ unlink("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\logbook\\js\\logstaff.js");
#unlink("C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\modules\\logbook\\js\\logcominterne.js");
- unlink("C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\modules\\logbook\\js\\logchild.js");
- unlink("C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\modules\\logbook\\js\\logactivity.js");
+ unlink("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\logbook\\js\\logchild.js");
+ unlink("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\logbook\\js\\logactivity.js");
#unlink("C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\modules\\logbook\\js\\logcominterne.js");
- remove_tree("C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\modules\\support\\js");
- remove_tree("C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\modules\\default_standard");
- remove_tree("C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\modules\\multisite");
+ remove_tree("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\support\\js");
+ remove_tree("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\default_standard");
+ remove_tree("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\multisite");
}
system('"C:\\Tools\\7za.exe" a -r creorga_'.$setup.'.jar chrome');
make_path("C:\\Users\\ksaff\\Release\\dist");
copy("C:\\Users\\ksaff\\Workspace\\xulrunner\\Creorga.exe","C:\\Users\\ksaff\\Release\\dist\\Creorga.exe");
copy("C:\\Users\\ksaff\\Workspace\\xulrunner\\vc_redist.x86.exe","C:\\Users\\ksaff\\Release\\dist\\vcredist_x86.exe");
-copy("C:\\Users\\ksaff\\Release\\tag\\app\\creorga_".$setup.".jar","C:\\Users\\ksaff\\Release\\dist\\creorga.jar");
+copy("C:\\Users\\ksaff\\Release\\tag\\app_v3\\creorga_".$setup.".jar","C:\\Users\\ksaff\\Release\\dist\\creorga.jar");
if ($setup eq "staff"){
- copy("C:\\Users\\ksaff\\Release\\tag\\app\\chrome.manifest_basic","C:\\Users\\ksaff\\Release\\dist\\chrome.manifest");
+ copy("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome.manifest_basic","C:\\Users\\ksaff\\Release\\dist\\chrome.manifest");
} elsif ($setup eq "localmanager") {
- copy("C:\\Users\\ksaff\\Release\\tag\\app\\chrome.manifest_localmanager","C:\\Users\\ksaff\\Release\\dist\\chrome.manifest");
+ copy("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome.manifest_localmanager","C:\\Users\\ksaff\\Release\\dist\\chrome.manifest");
} elsif ($setup eq "free") {
- copy("C:\\Users\\ksaff\\Release\\tag\\app\\chrome.manifest_free","C:\\Users\\ksaff\\Release\\dist\\chrome.manifest");
+ copy("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome.manifest_free","C:\\Users\\ksaff\\Release\\dist\\chrome.manifest");
} else {
- copy("C:\\Users\\ksaff\\Release\\tag\\app\\chrome.manifest","C:\\Users\\ksaff\\Release\\dist\\chrome.manifest");
+ copy("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome.manifest","C:\\Users\\ksaff\\Release\\dist\\chrome.manifest");
}
-rcopy("C:\\Users\\ksaff\\Release\\tag\\app\\defaults","C:\\Users\\ksaff\\Release\\dist\\defaults");
+rcopy("C:\\Users\\ksaff\\Release\\tag\\app_v3\\defaults","C:\\Users\\ksaff\\Release\\dist\\defaults");
if ($tag !~ /beta/) {
unlink("C:\\Users\\ksaff\\Release\\dist\\defaults\\preferences\\debug.js");
}
#C:\Program Files (x86)\WiX Toolset v3.11\bin\candle.exe -nologo "C:\Users\ksaff\Documents\creorga.wxs" -out "C:\Users\ksaff\Documents\creorga.wixobj" -ext WixUtilExtension -ext WixUIExtension
#C:\Program Files (x86)\WiX Toolset v3.11\bin\light.exe -nologo "C:\Users\ksaff\Documents\creorga.wixobj" -out "C:\Users\ksaff\Documents\creorga.msi" -ext WixUtilExtension -ext WixUIExtension
-system('"C:\\Program Files (x86)\\Inno Setup 5\\ISCC.exe" /dMyAppVersion='.$tag.' "C:\\Users\\ksaff\\Workspace\\creorga-devtools\\install\\windows\\creorga_setup_'.$setup.'.iss"');
+system('"C:\\Program Files (x86)\\Inno Setup 5\\ISCC.exe" /dMyAppVersion='.$tag.' "C:\\Users\\ksaff\\Workspace\\creorga\\install\\windows\\creorga_setup_'.$setup.'.iss"');
print "Setup created\n";
move("C:\\Users\\ksaff\\Release\\Setup_Creorga_".$tag.".exe","C:\\Users\\ksaff\\Release\\Setup_Creorga_".$tag."_".$setup.".exe");
#system('"C:\\Program Files (x86)\\Windows Kits\\10\\bin\\x86\\signtool.exe" sign /v /f "C:\\DKS\\Dokumente\\Certificates\\OS201603168961.pfx" /p "ltUedPZPjTTDke7pONAa" /v "C:\\Users\\ksaff\\Release\\Setup_Creorga_'.$tag.'_'.$setup.'.exe"');