-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate-setups.ps1
40 lines (35 loc) · 2.18 KB
/
create-setups.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<#
.Synopsis
Generates all supported MSI packages for testing purposes only.
.Description
This script builds and publish the ENBREA.CLI project and all supported MSI packages for testing purposes. There is no code signing.
.Parameter TargetFolder
The folder into which the final MSI packages are to be copied.
.Example
.\create-setups -TargetFolder "c:\MyFolder"
#>
param(
[Parameter(Mandatory=$true)]
[string]$TargetFolder
)
# Restore
dotnet restore "Enbrea.Cli.sln"
# Publish x64
dotnet publish "./src/Enbrea.Cli/Enbrea.Cli.csproj" /p:PublishProfile=x64
# Publish x86
dotnet publish "./src/Enbrea.Cli/Enbrea.Cli.csproj" /p:PublishProfile=x86
# Create MSI Setup x64
dotnet build "./setup/Enbrea.Cli.Setup.wixproj" -c Release -p:Platform=x64
# Create MSI Setup x86
dotnet build "./setup/Enbrea.Cli.Setup.wixproj" -c Release -p:Platform=x86
# Copy MSI Setups to target folder
Copy-Item -Path "./setup/bin/x64/Release/de-DE/enbrea.cli-x64.msi" -Destination (Join-Path -Path $TargetFolder -ChildPath "enbrea.cli-x64-de.msi")
Copy-Item -Path "./setup/bin/x64/Release/en-US/enbrea.cli-x64.msi" -Destination (Join-Path -Path $TargetFolder -ChildPath "enbrea.cli-x64-en.msi")
Copy-Item -Path "./setup/bin/x86/Release/de-DE/enbrea.cli-x86.msi" -Destination (Join-Path -Path $TargetFolder -ChildPath "enbrea.cli-x86-de.msi")
Copy-Item -Path "./setup/bin/x86/Release/en-US/enbrea.cli-x86.msi" -Destination (Join-Path -Path $TargetFolder -ChildPath "enbrea.cli-x86-en.msi")
# Create sub folders for additional binary files
if (!(Test-Path -Path (Join-Path -Path $TargetFolder -ChildPath "binaries/x86"))) {New-Item -Type Directory (Join-Path -Path $TargetFolder -ChildPath "binaries/x86")}
if (!(Test-Path -Path (Join-Path -Path $TargetFolder -ChildPath "binaries/x64"))) {New-Item -Type Directory (Join-Path -Path $TargetFolder -ChildPath "binaries/x64")}
# Additionally copy binary files to the target folder
Copy-Item -Path "./src/Enbrea.Cli/bin/Publish/win-x64/Enbrea.exe" -Destination (Join-Path -Path $TargetFolder -ChildPath "binaries/x64/Enbrea.exe")
Copy-Item -Path "./src/Enbrea.Cli/bin/Publish/win-x86/Enbrea.exe" -Destination (Join-Path -Path $TargetFolder -ChildPath "binaries/x86/Enbrea.exe")