@@ -108,14 +108,15 @@ func windowsMSI() error {
108
108
}
109
109
110
110
// Build package.
111
- verMajor , verMinor , verPatch := splitVersion (version )
111
+ verMajor , verMinor := splitVersion (version )
112
112
113
113
fmt .Fprintln (os .Stderr , "running wix candle" )
114
114
if err := runDir (win , filepath .Join (wix , "candle" ),
115
115
"-nologo" ,
116
116
"-arch" , msArch (),
117
117
"-dGoVersion=" + version ,
118
- fmt .Sprintf ("-dWixGoVersion=%v.%v.%v" , verMajor , verMinor , verPatch ),
118
+ fmt .Sprintf ("-dGoMajorVersion=%v" , verMajor ),
119
+ fmt .Sprintf ("-dWixGoVersion=1.%v.%v" , verMajor , verMinor ),
119
120
"-dArch=" + runtime .GOARCH ,
120
121
"-dSourceDir=" + goDir ,
121
122
filepath .Join (win , "installer.wxs" ),
@@ -274,12 +275,11 @@ func ext() string {
274
275
return ""
275
276
}
276
277
277
- var versionRe = regexp .MustCompile (`^go (\d+(\.\d+)* )` )
278
+ var versionRe = regexp .MustCompile (`^go1\. (\d+(\.\d+)? )` )
278
279
279
280
// splitVersion splits a Go version string such as "go1.9" or "go1.10.2" (as matched by versionRe)
280
- // into its three parts: major, minor, and patch
281
- // It's based on the Git tag.
282
- func splitVersion (v string ) (major , minor , patch int ) {
281
+ // into its parts: major and minor.
282
+ func splitVersion (v string ) (major , minor int ) {
283
283
m := versionRe .FindStringSubmatch (v )
284
284
if m == nil {
285
285
return
@@ -290,10 +290,6 @@ func splitVersion(v string) (major, minor, patch int) {
290
290
291
291
if len (parts ) >= 2 {
292
292
minor , _ = strconv .Atoi (parts [1 ])
293
-
294
- if len (parts ) >= 3 {
295
- patch , _ = strconv .Atoi (parts [2 ])
296
- }
297
293
}
298
294
}
299
295
return
@@ -359,7 +355,7 @@ var windowsData = map[string]string{
359
355
Name="Go Programming Language $(var.Arch) $(var.GoVersion)"
360
356
Language="1033"
361
357
Version="$(var.WixGoVersion)"
362
- Manufacturer="https://golang.org "
358
+ Manufacturer="https://go.dev "
363
359
UpgradeCode="$(var.UpgradeCode)" >
364
360
365
361
<Package
@@ -374,19 +370,25 @@ var windowsData = map[string]string{
374
370
375
371
<Property Id="ARPCOMMENTS" Value="The Go programming language is a fast, statically typed, compiled language that feels like a dynamically typed, interpreted language." />
376
372
<Property Id="ARPCONTACT" Value="[email protected] " />
377
- <Property Id="ARPHELPLINK" Value="https://golang.org /help/ " />
378
- <Property Id="ARPREADME" Value="https://golang.org " />
379
- <Property Id="ARPURLINFOABOUT" Value="https://golang.org " />
373
+ <Property Id="ARPHELPLINK" Value="https://go.dev /help" />
374
+ <Property Id="ARPREADME" Value="https://go.dev " />
375
+ <Property Id="ARPURLINFOABOUT" Value="https://go.dev " />
380
376
<Property Id="LicenseAccepted">1</Property>
381
377
<Icon Id="gopher.ico" SourceFile="images\gopher.ico"/>
382
378
<Property Id="ARPPRODUCTICON" Value="gopher.ico" />
383
379
<Property Id="EXISTING_GOLANG_INSTALLED">
384
380
<RegistrySearch Id="installed" Type="raw" Root="HKCU" Key="Software\GoProgrammingLanguage" Name="installed" />
385
381
</Property>
386
382
<MediaTemplate EmbedCab="yes" CompressionLevel="high" MaximumUncompressedMediaSize="10" />
383
+ <?if $(var.GoMajorVersion < 21) ?>
387
384
<Condition Message="Windows 7 (with Service Pack 1) or greater required.">
388
385
((VersionNT > 601) OR (VersionNT = 601 AND ServicePackLevel >= 1))
389
386
</Condition>
387
+ <?else?>
388
+ <Condition Message="Windows 10 or greater required.">
389
+ (VersionNT >= 1000)
390
+ </Condition>
391
+ <?endif?>
390
392
<MajorUpgrade AllowDowngrades="yes" />
391
393
392
394
<CustomAction
@@ -487,7 +489,7 @@ var windowsData = map[string]string{
487
489
<Custom Action="SetApplicationRootDirectory" Before="InstallFinalize" />
488
490
</InstallExecuteSequence>
489
491
490
- <!-- Notify top level applications of the new PATH variable (golang.org /issue/18680) -->
492
+ <!-- Notify top level applications of the new PATH variable (go.dev /issue/18680) -->
491
493
<CustomActionRef Id="WixBroadcastEnvironmentChange" />
492
494
493
495
<!-- Include the user interface -->
0 commit comments