@@ -6,16 +6,18 @@ Properties {
66
77 $version = " $base_version .$build_number "
88 $sem_version = $base_version
9+ $short_version = Get-ShortenedVersion $sem_version
910 if (-not [string ]::IsNullOrEmpty($version_status )) {
10- $sem_version = " $base_version -$ ( $version_status ) -$build_number "
11+ $sem_version = " $sem_version -$ ( $version_status ) -$build_number "
12+ $short_version = " $short_version -$ ( $version_status ) -$build_number "
1113 }
1214 $release_notes_version = Get-ShortenedVersion $base_version
1315 $config = ' Release'
14- $installer_product_id = [ System.Guid ]::Parse ($git_commit.Hash.SubString (0 , 32 ))
15- $installer_upgrade_code = [ System.Guid ]::Parse ($git_commit.Hash.SubString (1 , 32 ))
16+ $installer_product_id = New-Object System.Guid($git_commit.Hash.SubString (0 , 32 ))
17+ $installer_upgrade_code = New-Object System.Guid($git_commit.Hash.SubString (1 , 32 ))
1618
1719 Write-Host " $config Version $sem_version ($version )" - ForegroundColor Yellow
18-
20+
1921 $base_dir = Split-Path $psake.build_script_file
2022 $src_dir = " $base_dir "
2123 $tools_dir = " $base_dir \tools"
@@ -31,7 +33,7 @@ Properties {
3133 $docs_file = " $base_dir \Docs\Api\CSharpDriverDocs.shfbproj"
3234 $installer_file = " $base_dir \Installer\CSharpDriverInstaller.wixproj"
3335 $nuspec_file = " $base_dir \mongocsharpdriver.nuspec"
34- $chm_file = " $artifacts_dir \CSharpDriverDocs-$sem_version .chm"
36+ $chm_file = " $artifacts_dir \CSharpDriverDocs-$short_version .chm"
3537 $release_notes_file = " $base_dir \Release Notes\Release Notes v$release_notes_version .md"
3638 $license_file = " $base_dir \License.txt"
3739
@@ -107,8 +109,7 @@ Task Docs -precondition { BuildHasBeenRun } {
107109
108110 mv " $docs_dir \CSharpDriverDocs.chm" $chm_file
109111 mv " $docs_dir \Index.html" " $docs_dir \index.html"
110- Exec { & $zip_tool a " $artifacts_dir \CSharpDriverDocs-$sem_version -html.zip" " $docs_dir \*" }
111-
112+ Exec { & $zip_tool a " $artifacts_dir \CSharpDriverDocs-$short_version -html.zip" " $docs_dir \*" }
112113 RemoveDirectory $docs_dir
113114}
114115
@@ -119,29 +120,19 @@ task Zip -precondition { (BuildHasBeenRun) -and (DocsHasBeenRun) }{
119120
120121 mkdir - p $zip_dir | out-null
121122
122- mkdir - p $zip_dir \net35 | out-null
123123 $35_items = @ (" $35_build_dir \MongoDB.Bson.dll" , `
124124 " $35_build_dir \MongoDB.Bson.pdb" , `
125125 " $35_build_dir \MongoDB.Bson.xml" , `
126126 " $35_build_dir \MongoDB.Driver.dll" , `
127127 " $35_build_dir \MongoDB.Driver.pdb" , `
128128 " $35_build_dir \MongoDB.Driver.xml" )
129- cp $35_items " $zip_dir \net35"
130-
131- mkdir - p $zip_dir \net40 | out-null
132- $40_items = @ (" $40_build_dir \MongoDB.Bson.dll" , `
133- " $40_build_dir \MongoDB.Bson.pdb" , `
134- " $40_build_dir \MongoDB.Bson.xml" , `
135- " $40_build_dir \MongoDB.Driver.dll" , `
136- " $40_build_dir \MongoDB.Driver.pdb" , `
137- " $40_build_dir \MongoDB.Driver.xml" )
138- cp $40_items " $zip_dir \net40"
129+ cp $35_items " $zip_dir "
139130
140131 cp $license_file $zip_dir
141- cp " Release Notes\Release Notes v$release_notes_version .md" " $zip_dir \Release Notes v $release_notes_version .txt"
142- cp $chm_file $zip_dir
132+ cp " Release Notes\Release Notes v$release_notes_version .md" " $zip_dir \Release Notes.txt"
133+ cp $chm_file " $zip_dir \CSharpDriverDocs.chm "
143134
144- Exec { & $zip_tool a " $artifacts_dir \CSharpDriver-$sem_version .zip" " $zip_dir \*" }
135+ Exec { & $zip_tool a " $artifacts_dir \CSharpDriver-$short_version .zip" " $zip_dir \*" }
145136
146137 rd $zip_dir - rec - force | out-null
147138}
@@ -150,7 +141,7 @@ Task Installer -precondition { (BuildHasBeenRun) -and (DocsHasBeenRun) } {
150141 $release_notes_relative_path = Get-Item $release_notes_file | Resolve-Path - Relative
151142 $doc_relative_path = Get-Item $chm_file | Resolve-Path - Relative
152143
153- Exec { msbuild " $installer_file " / t:Rebuild / p:Configuration= $config / p:Version= $version / p:SemVersion= $sem_version / p:ProductId= $installer_product_id / p:UpgradeCode= $installer_upgrade_code / p:ReleaseNotes= $release_notes_relative_path / p:License= " License.rtf" / p:Documentation= $doc_relative_path / p:OutputPath= $artifacts_dir }
144+ Exec { msbuild " $installer_file " / t:Rebuild / p:Configuration= $config / p:Version= $version / p:SemVersion= $short_version / p:ProductId= $installer_product_id / p:UpgradeCode= $installer_upgrade_code / p:ReleaseNotes= $release_notes_relative_path / p:License= " License.rtf" / p:Documentation= $doc_relative_path / p:OutputPath= $artifacts_dir }
154145
155146 rm - force $artifacts_dir \* .wixpdb
156147}
0 commit comments