-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublish.ps1
35 lines (30 loc) · 1.21 KB
/
publish.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
# load XML file into local variable and cast as XML type.
$doc = [xml](Get-Content "D:\\CODES\\VS\\MediaPlayer\\AnotherMusicPlayer\\AnotherMusicPlayer.csproj")
$v = [version]$doc.Project.PropertyGroup.Version
$v = [version]::New($v.Major,$v.Minor,$v.Build,$v.Revision+1)
$AppVersion = ""
$InstallerVersion = "1.0.0"
$ret = Read-Host "Version number(default:" $v.ToString() ")"
if($ret.ToString().Trim() -eq ""){
$AppVersion = $v.ToString()
}
else{
$AppVersion = $ret.ToString().Trim()
}
$doc.Project.PropertyGroup.Version = $AppVersion
$doc.Project.PropertyGroup.AssemblyVersion = $AppVersion
$doc.Project.PropertyGroup.FileVersion = $AppVersion
$doc.save("D:\\CODES\\VS\\MediaPlayer\\AnotherMusicPlayer\\AnotherMusicPlayer.csproj")
$confirmation = Read-Host "Installer version(default:" $InstallerVersion ", n=abort compiling)"
if ($confirmation.ToString().Trim() -eq 'n') {
}
else {
if ($confirmation.ToString().Trim() -eq '') {
}
else{
$InstallerVersion = $confirmation.ToString().Trim()
}
"Compiling"
dotnet publish D:\CODES\VS\MediaPlayer -p:PublishProfile=AnyCPU
cmd /C "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" D:\CODES\VS\MediaPlayer\Installer-AnyCPU.iss /DMyInstallerVersion=$InstallerVersion
}