Skip to content

Commit

Permalink
Скрипты для публикации
Browse files Browse the repository at this point in the history
  • Loading branch information
MarketKernel committed Nov 30, 2018
1 parent 89a237b commit 5a08986
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 57 deletions.
4 changes: 1 addition & 3 deletions Src/BuildScripts/Build-MSI.cmd
Expand Up @@ -32,6 +32,4 @@ light.exe %OUT_FOLDER%\Components.wixobj %OUT_FOLDER%\Product.wixobj -cultures:r

signtool.exe sign /sha1 %CertThumbprint% /t %TimeStampingServer% /d "WMBusinessTools" /du "https://www.webmoney-business-tools.com/" %OUT_FILE_PATH%

popd

pause
popd
10 changes: 8 additions & 2 deletions Src/BuildScripts/ClearAll.cmd
Expand Up @@ -5,6 +5,8 @@ echo ========== START ==========
rd /s /q .\..\SupportAssistant\bin
rd /s /q .\..\SupportAssistant\obj

rd /s /q .\..\TestResults

rd /s /q .\..\WebMoney.Services\bin
rd /s /q .\..\WebMoney.Services\obj

Expand All @@ -17,11 +19,15 @@ rd /s /q .\..\WebMoney.Services.Tests\obj
rd /s /q .\..\WMBusinessTools\bin
rd /s /q .\..\WMBusinessTools\obj

rd /s /q .\..\WMBusinessTools.Agent\bin
rd /s /q .\..\WMBusinessTools.Agent\obj

rd /s /q .\..\WMBusinessTools.Extensions\bin
rd /s /q .\..\WMBusinessTools.Extensions\obj

rd /s /q .\..\WMBusinessTools.Extensions.Contracts\bin
rd /s /q .\..\WMBusinessTools.Extensions.Contracts\obj

echo ========== DONE ==========
pause
rd /s /q .\..\WMBusinessTools.Setup.WiX\Output

echo ========== DONE ==========
12 changes: 9 additions & 3 deletions Src/BuildScripts/Prepare.Production.ps1
@@ -1,5 +1,7 @@
Add-Type -Assembly "System.IO.Compression.FileSystem";

cmd.exe /c ".\ClearAll.cmd"

$BIN_FOLDER = ".\..\WMBusinessTools\bin"

cmd.exe /c ".\Build.Production.cmd"
Expand Down Expand Up @@ -29,9 +31,11 @@ $archiveFilePath = "$BIN_FOLDER\WMBusinessTools-v$version.zip";
[System.IO.Compression.ZipFile]::CreateFromDirectory("$BIN_FOLDER\Production", $archiveFilePath)

# Ïîäãîòîâêà App.config äëÿ MSI
[xml]$configDocument = Get-Content -Path "$BIN_FOLDER\Production\WMBusinessTools.exe.config"
$configDocument.SelectSingleNode("configuration/appSettings/add[@key='OmitPrecompilation']").Attributes["value"].Value = "True"
$configDocument.Save("$BIN_FOLDER\Production\WMBusinessTools.exe.config")
#[xml]$configDocument = Get-Content -Path "$BIN_FOLDER\Production\WMBusinessTools.exe.config"
#$configDocument.SelectSingleNode("configuration/appSettings/add[@key='OmitPrecompilation']").Attributes["value"].Value = "True"
#$configDocument.Save("$BIN_FOLDER\Production\WMBusinessTools.exe.config")

cmd.exe /c ".\Build-MSI.cmd"

# Ïîäãîòîâêà ìàíèôåñòà
$archiveHash = (Get-FileHash -Path $archiveFilePath -Algorithm SHA256).Hash
Expand All @@ -46,4 +50,6 @@ $packageElement.Attributes["Digest"].Value = $archiveHash
$packageElement.InnerText = "http://www.webmoney-business-tools.com/dist/$publicationFolder/WMBusinessTools-v$version.zip"
$manifestDocument.Save(".\..\..\Tools\ManifestSigner\Manifest.xml")

cmd.exe /c ".\..\..\Tools\ManifestSigner\Sign.cmd"

pause
8 changes: 8 additions & 0 deletions Src/BuildScripts/Publish-ClickOnce.ps1
@@ -0,0 +1,8 @@
function Publish-Folder([String]$keyPrefix, [String]$folder)
{
Write-S3Object -Region $Region -BucketName $BucketName -KeyPrefix $keyPrefix -Folder $folder -Recurse -PublicReadOnly -Force
}

#Remove-S3Object -Region "us-east-1" -BucketName "cross-test" -KeyCollection (Get-S3Object -Region "us-east-1" -BucketName "cross-test" -KeyPrefix "tst1/Application Files" | select -ExpandProperty Key) -Force
# exe - удалить (не копировать!)
#Publish-Folder "tst1" ".\..\..\Ext\PartialTrustInstaller\publish"
58 changes: 17 additions & 41 deletions Src/BuildScripts/Publish.ps1
@@ -1,56 +1,32 @@
Add-Type -Assembly "System.IO.Compression.FileSystem";

Import-Module AWSPowerShell

$Region = "us-east-1"
#$BucketName = "webmoney-business-tools"
$BucketName = "cross-test"
$BucketName = "webmoney-business-tools"
$BIN_FOLDER = ".\..\WMBusinessTools\bin"
$MSI_FOLDER = ".\..\WMBusinessTools.Setup.WiX\Output"

function Publish-File([String]$key, [String]$file)
{
Write-S3Object -Region $Region -BucketName $BucketName -Key $key -File $file -PublicReadOnly -Force

#$user = New-Object -TypeName Amazon.S3.Model.S3Grantee
#$user.URI = "http://acs.amazonaws.com/groups/global/AllUsers"

#$grantRead = New-Object -TypeName Amazon.S3.Model.S3Grant
#$grantRead.Grantee = $user
#$grantRead.Permission = [Amazon.S3.S3Permission]::READ

#$acl = Get-S3Acl -Region $Region -BucketName $BucketName
#$acl.Grants += @($grantRead)

#Set-S3Acl -Region $Region -BucketName $BucketName -Key $key -Grant $acl.Grants -OwnerId $acl.Owner.Id
}

function Publish-Folder([String]$keyPrefix, [String]$folder)
{
Write-S3Object -Region $Region -BucketName $BucketName -KeyPrefix $keyPrefix -Folder $folder -Recurse -PublicReadOnly -Force
$version = [System.Diagnostics.FileVersionInfo]::GetVersionInfo("$BIN_FOLDER\Production\WMBusinessTools.exe").FileVersion
$publicationFolder = "v" + ($version -replace "\.", "-")

#$user = New-Object -TypeName Amazon.S3.Model.S3Grantee
#$user.URI = "http://acs.amazonaws.com/groups/global/AllUsers"

#$grantRead = New-Object -TypeName Amazon.S3.Model.S3Grant
#$grantRead.Grantee = $user
#$grantRead.Permission = [Amazon.S3.S3Permission]::READ
# 1. Ïóáëèêóåì ZIP-àðõèâ
Publish-File "dist/$($publicationFolder)/WMBusinessTools-v$($version).zip" "$($BIN_FOLDER)\WMBusinessTools-v$($version).zip"

#$acl = Get-S3Acl -Region $Region -BucketName $BucketName
#$acl.Grants += @($grantRead)
# 2. Ïóáëèêóåì ôàéë ìàíèôåñòà
Publish-File "dist/Manifest.xml" ".\..\..\Tools\ManifestSigner\Signed\Manifest.xml"

#Set-S3Acl -Region $Region -BucketName $BucketName -Key $key -Grant $acl.Grants -OwnerId $acl.Owner.Id
}

Remove-S3Object -Region "us-east-1" -BucketName "cross-test" -KeyCollection (Get-S3Object -Region "us-east-1" -BucketName "cross-test" -KeyPrefix "tst1/Application Files" | select -ExpandProperty Key) -Force
# exe - óäàëèòü (íå êîïèðîâàòü!)
Publish-Folder "tst1" ".\..\..\Ext\PartialTrustInstaller\publish"

# 1. óáëèêóåì ZIP-àðõèâû
#Publish-File $BucketName "pslfld/WMBusinessTools-v3.1.1.0.zip" ".\..\WMBusinessTools\bin\WMBusinessTools-v3.1.1.0.zip"

# 2. óáëèêóåì ôàéë ìàíèôåñòà
#Publish-File $BucketName "dist/Manifest.xml" ".\..\..\Tools\ManifestSigner\Signed\Manifest.xml"

# 3. óáëèêóåì MSI
# 3. Ïóáëèêóåì MSI
Publish-File "dist/$($publicationFolder)/WMBusinessTools.Setup-x32.msi" "$($MSI_FOLDER)\WMBusinessTools.Setup-x32.msi"
Publish-File "dist/$($publicationFolder)/WMBusinessTools.Setup-x64.msi" "$($MSI_FOLDER)\WMBusinessTools.Setup-x64.msi"

# 4. Invalidating objects
#$callerReference = Get-Date -UFormat "%Y%m%d%H%M%S"
#New-CFInvalidation -DistributionId "E1WLSVLBT9KYI8" -InvalidationBatch_CallerReference $callerReference -Paths_Item "/dist*" -Paths_Quantity 1
$callerReference = Get-Date -UFormat "%Y%m%d%H%M%S"
New-CFInvalidation -DistributionId "E1WLSVLBT9KYI8" -InvalidationBatch_CallerReference $callerReference -Paths_Item "/dist*" -Paths_Quantity 1

pause
8 changes: 4 additions & 4 deletions Src/WMBusinessTools.Setup.WiX/Variables.wxi
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>

<Include>
<?define ProductName="WMBusinessTools" ?>
<?define ProductVersion="3.1.2.0" ?>
<?define ProductName="WMBusinessTools-3.1" ?>
<?define ProductVersion="3.1.3.0" ?>
<?define Manufacturer="MarketKernel" ?>
<?define ProductionDir=".\..\WMBusinessTools\bin\Production\" ?>
<?define AboutUrl="https://www.webmoney-business-tools.com/" ?>
Expand All @@ -12,12 +12,12 @@
<?define ExecTarget="File_WMBusinessTools.exe" ?>
<?if $(var.Platform) = x64 ?>
<?define ProductCode = "8671ea88-5543-48ea-b1d9-9de418405324" ?>
<?define UpgradeCode = "df447063-c9b6-46d2-8760-31a106547ff1" ?>
<?define UpgradeCode = "DF447063-C9B6-46D2-8760-31A106547FF1" ?>
<?define Win64 = "yes" ?>
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
<?else ?>
<?define ProductCode = "11768769-e538-423f-bc85-141545bc69f0" ?>
<?define UpgradeCode = "df447063-c9b6-46d2-8760-31a106547ff1" ?>
<?define UpgradeCode = "DF447063-C9B6-46D2-8760-31A106547FF1" ?>
<?define Win64 = "no" ?>
<?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
<?endif ?>
Expand Down
2 changes: 2 additions & 0 deletions Src/WMBusinessTools/InitializationForm.cs
Expand Up @@ -166,6 +166,8 @@ private void mBackgroundWorker_RunWorkerCompleted(object sender, System.Componen
MessageBox.Show(this, message, Resources.InitializationForm_mBackgroundWorker_RunWorkerCompleted_Error, MessageBoxButtons.OK, MessageBoxIcon.Error);

backButton_Click(this, null);

notPrecompileRadioButton.Checked = true;
return;
}

Expand Down
2 changes: 1 addition & 1 deletion Src/WMBusinessTools/Properties/AssemblyInfo.cs
Expand Up @@ -29,4 +29,4 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.0.0.0")]
[assembly: AssemblyFileVersion("3.1.1.0")]
[assembly: AssemblyFileVersion("3.1.3.0")]
2 changes: 1 addition & 1 deletion Tools/ManifestSigner/Manifest.xml
@@ -1,4 +1,4 @@
<Manifest>
<Package OSMajorVersion="5" Version="3.0.1.0" ReleaseDate="11/21/2018" Digest="B07F3FF1735A5F8FB9CCD29AC1F55039CF2CD21258F9598203A6DC2A32A8AFEF">http://www.webmoney-business-tools.com/dist/v3-0-1-0/WMBusinessTools-v3.0.1.0.zip</Package>
<Package OSMajorVersion="6" Version="3.1.1.0" ReleaseDate="11/27/2018" Digest="531966C87B9D97C611E0C1685C3597EEC8E176E99EFBD6582E29D66D6AB5FE14">http://www.webmoney-business-tools.com/dist/v3-1-1-0/WMBusinessTools-v3.1.1.0.zip</Package>
<Package OSMajorVersion="6" Version="3.1.3.0" ReleaseDate="11/30/2018" Digest="1D9F8C3390F4B237DF486EB6023953F6F0DC7FE0073F95663D95E21DA64B0615">http://www.webmoney-business-tools.com/dist/v3-1-3-0/WMBusinessTools-v3.1.3.0.zip</Package>
</Manifest>
4 changes: 3 additions & 1 deletion Tools/ManifestSigner/Sign.cmd
@@ -1 +1,3 @@
ManifestSigner Manifest.xml ".\Signed\Manifest.xml" fcb671b0b83566d01aee0e142e9ba5a999208ee4
pushd "%~dp0"
ManifestSigner Manifest.xml ".\Signed\Manifest.xml" fcb671b0b83566d01aee0e142e9ba5a999208ee4
popd
2 changes: 1 addition & 1 deletion Tools/ManifestSigner/Signed/Manifest.xml
@@ -1 +1 @@
<Manifest><Package OSMajorVersion="5" Version="3.0.1.0" ReleaseDate="11/21/2018" Digest="B07F3FF1735A5F8FB9CCD29AC1F55039CF2CD21258F9598203A6DC2A32A8AFEF">http://www.webmoney-business-tools.com/dist/v3-0-1-0/WMBusinessTools-v3.0.1.0.zip</Package><Package OSMajorVersion="6" Version="3.1.1.0" ReleaseDate="11/21/2018" Digest="77DF67134EB29099BE409C3EB453D3B41879F37A9A00A3EE9FFC52ADCFA27060">http://www.webmoney-business-tools.com/dist/v3-1-1-0/WMBusinessTools-v3.1.1.0.zip</Package><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /><SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256" /><Reference URI=""><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" /><DigestValue>i/625F8cYQ77HT/EEzeG9IzoZsXzSOURCEeEqS2LXPU=</DigestValue></Reference></SignedInfo><SignatureValue>gKlJQAY3E6ToLe1sIWLCJcJWOpD9Gly1+lW8+g+i1XAo51LPEFiBwlvHcvQ5c3XCLqI4wyc59cHNYsJ++beNUn6/cIhTw68cYVTriADMSaYjoogamwXXmiQrdsyfL6txkICHgalROKsnHjRRSSGGJu1Sp1J8i/Rv6BLllBOfVZhv4ilmsaXjsmZ8IQH/32lHrtGDA8gMmC8LnCEC4yWyO8mzhvNcYm4IfGFUiCw6Gzpb3GB9lRQbuFpj0ZjKT57eHb6e9JZHk0AzANY/9Nk4KsgRHZSriVhUlT7QBn7Pm0HXs4CPcFnoPAPdUu795KsbkimVAZ5kLsSpcXxnfKvMZA==</SignatureValue></Signature></Manifest>
<Manifest><Package OSMajorVersion="5" Version="3.0.1.0" ReleaseDate="11/21/2018" Digest="B07F3FF1735A5F8FB9CCD29AC1F55039CF2CD21258F9598203A6DC2A32A8AFEF">http://www.webmoney-business-tools.com/dist/v3-0-1-0/WMBusinessTools-v3.0.1.0.zip</Package><Package OSMajorVersion="6" Version="3.1.3.0" ReleaseDate="11/30/2018" Digest="1D9F8C3390F4B237DF486EB6023953F6F0DC7FE0073F95663D95E21DA64B0615">http://www.webmoney-business-tools.com/dist/v3-1-3-0/WMBusinessTools-v3.1.3.0.zip</Package><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /><SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256" /><Reference URI=""><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" /><DigestValue>C19xEyImHXV5eT6x+fcBEBs1c4nzeDfuasm5sn/VYpk=</DigestValue></Reference></SignedInfo><SignatureValue>jhZJUrZ0hgJyLs//EvQpTY6mKl8X1lbIhvB4pudRnTRFZ4YnXnU8m9dRFGSUxGuKy2W8WLe3CWyOtuXDcEZ7v8lbMFxM4od4pC6kLTEMP4E7DqDc8+s62Lgta+0+sWPcCZxKFCJe54oFVXezlECYrTGa2xnNzyae1i8LraFZMt/htaGCQn9EG/i/vyQWZNku0K/500sL7KEAzXcyU4d8VyzsPuKSyLIfL5yTwcmEmzuk0Jab6KQwUDbjd1FHs38rvCXQQu3OSQQTD2i2anqfS1pA1rHsQoiJD1MDbQQr61We4MVLXo/OVk4n+OkIEnn5LtfqcxgzxWzOV/ZQTUiYjA==</SignatureValue></Signature></Manifest>

0 comments on commit 5a08986

Please sign in to comment.