Skip to content

Commit c839300

Browse files
committed
WIP
1 parent 2b302ce commit c839300

22 files changed

+776
-0
lines changed

build/run.cmd

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ IF DEFINED USG (
2727
ECHO 5: Build installer PgAdmin3
2828
ECHO 6: Make PostgreSQL and PgAdmin3 archives
2929
ECHO 7: Build pgbouncer
30+
ECHO 8: Build pg_probackup
31+
ECHO 8: Build pg_probackup installer
3032
PAUSE
3133
EXIT /b 1
3234
)
@@ -95,6 +97,16 @@ IF "%~1"=="7" (
9597
CMD.EXE /C %ROOT%\build\helpers\pgbouncer.cmd || GOTO :ERROR
9698
)
9799

100+
IF "%~1"=="8" (
101+
TITLE Build PG_PROBACKUP
102+
CMD.EXE /C %ROOT%\build\helpers\probackup.cmd || GOTO :ERROR
103+
)
104+
105+
IF "%~1"=="9" (
106+
TITLE Build PG_PROBACKUP installer
107+
CMD.EXE /C %ROOT%\build\helpers\probackup_installer.cmd || GOTO :ERROR
108+
)
109+
98110
GOTO :DONE
99111

100112
:ERROR

pg_probackup/Files.wxs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
3+
<?include Variables.wxi?>
4+
<Fragment>
5+
<DirectoryRef Id = "INSTALLLOCATION">
6+
<Component Id="ProductComponent" Guid="$(var.ComponentCode)" Win64="$(var.Win64)">
7+
<File Id='libeay32.dll' DiskId='1' Source='./out_full/libeay32.dll'/>
8+
<File Id='libiconv.dll' DiskId='1' Source='./out_full/libiconv.dll'/>
9+
<File Id='libintl.dll' DiskId='1' Source='./out_full/libintl.dll'/>
10+
<File Id='libpq.dll' DiskId='1' Source='./out_full/libpq.dll'/>
11+
<File Id='pg_probackup.exe' DiskId='1' Source='./out_full/pg_probackup.exe'/>
12+
<File Id='ssleay32.dll' DiskId='1' Source='./out_full/ssleay32.dll'/>
13+
<File Id='zlib1.dll' DiskId='1' Source='./out_full/zlib1.dll'/>
14+
</Component>
15+
</DirectoryRef>
16+
</Fragment>
17+
</Wix>

pg_probackup/Product.wxs

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
3+
<?include Variables.wxi?>
4+
<!-- Product details -->
5+
6+
<Product Id="$(var.ProductCode)"
7+
Name="$(var.APPNAME) $(var.APPVERSION) for $(var.PG_DEF_BRANDING)"
8+
Language="1049"
9+
Version="$(var.APPVERSION)"
10+
Manufacturer="$(var.APPVENDOR)"
11+
UpgradeCode="$(var.UpgradeCode)" >
12+
13+
<!-- Package details -->
14+
<!-- Id ="c5311991-bf45-4bde-b5d0-1212c13b160e" -->
15+
<!-- Id ="88aa1355-9eb8-422c-ac4f-8ddce5ddec26" -->
16+
17+
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine"
18+
Keywords="$(var.APPKEYWORDS)"
19+
Comments="$(var.APPCOMMENTS)"
20+
Manufacturer="$(var.APPVENDOR)"
21+
Languages="1049"
22+
Platform ='$(var.Platform)'
23+
24+
/>
25+
26+
<Property Id="INSTALLLOCATION">
27+
<!-- <RegistrySearch Id="my_app_dir" Root="HKCU" Key="Software\VVS\VvsCommerceSQL" Type="raw" /> -->
28+
<RegistrySearch Id="my_app_dir" Root="HKLM" Key="$(var.PG_REG_KEY)" Name ="Base Directory" Type="raw" Win64="no"/>
29+
<!-- <RegistrySearch Id="my_app_dir" Root="HKLM" Key="SOFTWARE\WOW6432Node\PostgresPro\X64\PostgresPro\10\Installations\postgresql-10" Name ="Base Directory" Type="raw" /> OK -->
30+
31+
</Property>
32+
33+
<Condition Message="Инсталляция $(var.PG_DEF_BRANDING) не найдена!">
34+
<!-- <![CDATA[Installed OR (VersionNT >= 600)]]> VersionNT64 -->
35+
<![CDATA[Installed OR (INSTALLLOCATION <> "")]]>
36+
</Condition>
37+
38+
39+
<!-- Directories -->
40+
<Directory Id="TARGETDIR" Name="SourceDir">
41+
<Directory Id="INSTALLLOCATION" Name="[INSTALLLOCATION]"/>
42+
</Directory>
43+
44+
45+
46+
<!-- Features -->
47+
<Feature Id="base" Title="$(var.APPNAME) - $(var.APPCOMMENTS)" Level="1" Description="$(var.APPDESCRIPTION)" Display="expand" AllowAdvertise="no" Absent="disallow">
48+
<ComponentRef Id="ProductComponent" />
49+
</Feature>
50+
51+
52+
<Media Id="1" EmbedCab="yes" Cabinet="installer.cab"/>
53+
<!-- Properties -->
54+
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLLOCATION" />
55+
<!-- UI <UIRef Id="WixUI_FeatureTree" /> -->
56+
<UIRef Id="WixUI_InstallDir" />
57+
<!-- <UIRef Id="WixUI_Minimal" /> -->
58+
59+
<!--
60+
<WixVariable Id="WixUILicenseRtf" Value="$(var.SRCPATH)/bin/licence.rtf" />
61+
<WixVariable Id="WixUIDialogBmp" Value="$(var.SRCPATH)/bin/background.bmp" />
62+
<WixVariable Id="WixUIBannerBmp" Value="$(var.SRCPATH)/bin/banner.bmp" />
63+
-->
64+
<WixVariable Id="WixUILicenseRtf" Value="licence.rtf" />
65+
<WixVariable Id="WixUIDialogBmp" Value="background.bmp" />
66+
<WixVariable Id="WixUIBannerBmp" Value="banner.bmp" />
67+
68+
69+
<!-- <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> -->
70+
<!--OK - but 2 call <InstallUISequence>
71+
<Custom Action='BrowseForFile' After='PrepareDlg'/>
72+
73+
</InstallUISequence> AllowSameVersionUpgrades-->
74+
<InstallUISequence>
75+
</InstallUISequence>
76+
77+
<!--
78+
<Upgrade Id="$(var.UpgradeCode)">
79+
<UpgradeVersion Minimum="$(var.APPVERSION)" OnlyDetect="yes" Property="NEWERVERSIONDETECTED" />
80+
<UpgradeVersion Minimum="0.0.1" IncludeMinimum="yes" Maximum="$(var.APPVERSION)" IncludeMaximum="no" Property="OLDERVERSIONBEINGUPGRADED" />
81+
<UpgradeVersion Minimum="1.0.0" IncludeMinimum="yes" Maximum="10.0.0" IncludeMaximum="yes" Property="OLDERVERSIONBEINGUPGRADED" />
82+
83+
-->
84+
85+
<!--
86+
<UpgradeVersion Property="UPGRADE" OnlyDetect="yes" Maximum="$(var.APPVERSION)" />
87+
<UpgradeVersion Property="DOWNGRADE" OnlyDetect="yes" Minimum="$(var.APPVERSION)" IncludeMinimum="no" />
88+
<UpgradeVersion Property="PREVIOUSVERSIONSINSTALLED" MigrateFeatures="yes" Minimum="0.0.0" />
89+
-->
90+
<!--
91+
92+
</Upgrade>
93+
-->
94+
95+
<!--
96+
<MajorUpgrade
97+
AllowDowngrades="yes" />
98+
-->
99+
100+
</Product>
101+
102+
103+
</Wix>

pg_probackup/Product_separate.wxs

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
3+
<?include Variables.wxi?>
4+
<!-- Product details -->
5+
6+
<Product Id="$(var.ProductCode)"
7+
Name="$(var.APPNAME) $(var.APPVERSION) for $(var.PG_DEF_BRANDING)"
8+
Language="1049"
9+
Version="$(var.APPVERSION)"
10+
Manufacturer="$(var.APPVENDOR)"
11+
UpgradeCode="$(var.UpgradeCode)" >
12+
13+
<!-- Package details -->
14+
<!-- Id ="c5311991-bf45-4bde-b5d0-1212c13b160e" -->
15+
<!-- Id ="88aa1355-9eb8-422c-ac4f-8ddce5ddec26" -->
16+
17+
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine"
18+
Keywords="$(var.APPKEYWORDS)"
19+
Comments="$(var.APPCOMMENTS)"
20+
Manufacturer="$(var.APPVENDOR)"
21+
Languages="1049"
22+
Platform ='$(var.Platform)'
23+
24+
/>
25+
<?if $(var.Platform) = x64 ?>
26+
<?define bitness = "(64 bit)" ?>
27+
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
28+
<?else ?>
29+
<?define bitness = "(32 bit)" ?>
30+
<?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
31+
<?endif ?>
32+
33+
34+
<!-- Directories -->
35+
<Directory Id="TARGETDIR" Name="SourceDir">
36+
<Directory Id="$(var.PlatformProgramFilesFolder)" Name="PFiles">
37+
<Directory Id="BASEDIR" Name="$(var.APPNAME)">
38+
39+
<Directory Id="BRANDDIR" Name="$(var.APPVERSION)">
40+
<Directory Id="INSTALLLOCATION" Name="$(var.PG_DEF_BRANDING)">
41+
</Directory>
42+
</Directory>
43+
</Directory>
44+
</Directory>
45+
</Directory>
46+
47+
48+
49+
<!-- Features -->
50+
<Feature Id="base" Title="$(var.APPNAME) - $(var.APPCOMMENTS)" Level="1" Description="$(var.APPDESCRIPTION)" Display="expand" AllowAdvertise="no" Absent="disallow">
51+
<ComponentRef Id="ProductComponent" />
52+
</Feature>
53+
54+
55+
<Media Id="1" EmbedCab="yes" Cabinet="installer.cab"/>
56+
<!-- Properties -->
57+
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLLOCATION" />
58+
<!-- UI <UIRef Id="WixUI_FeatureTree" /> -->
59+
<UIRef Id="WixUI_InstallDir" />
60+
<!-- <UIRef Id="WixUI_Minimal" /> -->
61+
62+
<!--
63+
<WixVariable Id="WixUILicenseRtf" Value="$(var.SRCPATH)/bin/licence.rtf" />
64+
<WixVariable Id="WixUIDialogBmp" Value="$(var.SRCPATH)/bin/background.bmp" />
65+
<WixVariable Id="WixUIBannerBmp" Value="$(var.SRCPATH)/bin/banner.bmp" />
66+
-->
67+
<WixVariable Id="WixUILicenseRtf" Value="licence.rtf" />
68+
<WixVariable Id="WixUIDialogBmp" Value="background.bmp" />
69+
<WixVariable Id="WixUIBannerBmp" Value="banner.bmp" />
70+
71+
72+
<!-- <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> -->
73+
<!--OK - but 2 call <InstallUISequence>
74+
<Custom Action='BrowseForFile' After='PrepareDlg'/>
75+
76+
</InstallUISequence> AllowSameVersionUpgrades-->
77+
<InstallUISequence>
78+
</InstallUISequence>
79+
80+
<!--
81+
<Upgrade Id="$(var.UpgradeCode)">
82+
<UpgradeVersion Minimum="$(var.APPVERSION)" OnlyDetect="yes" Property="NEWERVERSIONDETECTED" />
83+
<UpgradeVersion Minimum="0.0.1" IncludeMinimum="yes" Maximum="$(var.APPVERSION)" IncludeMaximum="no" Property="OLDERVERSIONBEINGUPGRADED" />
84+
<UpgradeVersion Minimum="1.0.0" IncludeMinimum="yes" Maximum="10.0.0" IncludeMaximum="yes" Property="OLDERVERSIONBEINGUPGRADED" />
85+
86+
-->
87+
88+
<!--
89+
<UpgradeVersion Property="UPGRADE" OnlyDetect="yes" Maximum="$(var.APPVERSION)" />
90+
<UpgradeVersion Property="DOWNGRADE" OnlyDetect="yes" Minimum="$(var.APPVERSION)" IncludeMinimum="no" />
91+
<UpgradeVersion Property="PREVIOUSVERSIONSINSTALLED" MigrateFeatures="yes" Minimum="0.0.0" />
92+
-->
93+
<!--
94+
95+
</Upgrade>
96+
-->
97+
98+
<!--
99+
<MajorUpgrade
100+
AllowDowngrades="yes" />
101+
-->
102+
103+
</Product>
104+
105+
106+
</Wix>

pg_probackup/RegenGuids.pl

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
use Win32;
2+
3+
my $filename = shift @ARGV;
4+
5+
die "Usage: regenguids.pl <filename>\n\n" unless ($filename);
6+
7+
sub MakeGuid {
8+
my $u = Win32::GuidGen();
9+
$u =~ s/[{}]//g;
10+
return $u;
11+
}
12+
13+
open(IN,"<$filename");
14+
open(OUT, ">$filename.out") || die "Could not open output file ($filename.out)!\n";
15+
16+
while(<IN>) {
17+
chomp();
18+
if(/(.*)([0-9A-Fa-f]{8}-?[0-9A-Fa-f]{4}-?[0-9A-Fa-f]{4}-?[0-9A-Fa-f]{4}-?[0-9A-Fa-f]{12})(.*)/) {
19+
$newguid=MakeGuid();
20+
print OUT $1.$newguid.$3;
21+
} else { print OUT $_ ;}
22+
print OUT "\n";
23+
}
24+

pg_probackup/Variables.wxi

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Include>
3+
<?define APPNAME="pg_probackup" ?>
4+
<?define ProductCode="{CBE0BAA5-E1D0-49B8-AF6B-942B77B3477A}"?>
5+
<?define UpgradeCode="{ECAF8334-18B0-42D4-81D1-2A8C6DD1CC03}"?>
6+
<?define ComponentCode="{BE8D32ED-54F7-406E-9967-DCE3CBAD679E}"?>
7+
<?define ComponentCode2="{905B24CF-3433-4830-B068-BB4A1AC60CF6}"?>
8+
<?define APPCOMMENTS="pg_probackup"?>
9+
<?define APPKEYWORDS="PostgreSQL, pg_probackup"?>
10+
<?define APPVENDOR="Postgres Professional Russia"?>
11+
<?define APPDESCRIPTION="pg_probackup"?>
12+
<?define Win64 = "yes" ?>
13+
<!--
14+
<?define APPVERSION="2.0.26" ?>
15+
<?define PRODUCT_DIR_REGKEY="SOFTWARE\PostgresPro\X64\PostgresProEnterprise\11\Installations\postgresql-11"?>
16+
<?define PG_DEF_BRANDING="PostgresProEnterprise 11 (64bit)"?> -->
17+
<?define Platform="x64" ?>
18+
</Include>

pg_probackup/background.bmp

152 KB
Binary file not shown.

pg_probackup/banner.bmp

83.9 KB
Binary file not shown.

0 commit comments

Comments
 (0)