@@ -61,18 +61,17 @@ function Validate-Directory ($output) {
6161}
6262
6363
64- function Pack-Squirrel-Installer ($path , $version , $output ) {
64+ function Pack-Squirrel-Installer ($path , $version , $output , $inputPath = " $path \Output\Release " , $suffix = " " ) {
6565 # msbuild based installer generation is not working in appveyor, not sure why
6666 Write-Host " Begin pack squirrel installer"
6767
6868 $spec = " $path \Scripts\flowlauncher.nuspec"
69- $input = " $path \Output\Release"
7069
7170 Write-Host " Packing: $spec "
72- Write-Host " Input path: $input "
71+ Write-Host " Input path: $inputPath "
7372
7473 # dotnet pack is not used because ran into issues, need to test installation and starting up if to use it.
75- nuget pack $spec - Version $version - BasePath $input - OutputDirectory $output - Properties Configuration= Release
74+ nuget pack $spec - Version $version - BasePath $inputPath - OutputDirectory $output - Properties Configuration= Release
7675
7776 $nupkg = " $output \FlowLauncher.$version .nupkg"
7877 Write-Host " nupkg path: $nupkg "
@@ -82,13 +81,13 @@ function Pack-Squirrel-Installer ($path, $version, $output) {
8281 New-Alias Squirrel $env: USERPROFILE \.nuget\packages\squirrel.windows\1.9 .0 \tools\Squirrel.exe - Force
8382 # why we need Write-Output: https://github.com/Squirrel/Squirrel.Windows/issues/489#issuecomment-156039327
8483 # directory of releaseDir in squirrel can't be same as directory ($nupkg) in releasify
85- $temp = " $output \Temp"
84+ $temp = " $output \Temp$suffix "
8685
8786 Squirrel -- releasify $nupkg -- releaseDir $temp -- setupIcon $icon -- no- msi | Write-Output
8887 Move-Item $temp \* $output - Force
8988 Remove-Item $temp
9089
91- $file = " $output \Flow-Launcher-Setup.exe"
90+ $file = " $output \Flow-Launcher-Setup$suffix .exe"
9291 Write-Host " Filename: $file "
9392
9493 Move-Item " $output \Setup.exe" $file - Force
@@ -106,11 +105,22 @@ function Publish-Self-Contained ($p) {
106105 dotnet publish - c Release $csproj / p:PublishProfile= $profile
107106}
108107
109- function Publish-Portable ($outputLocation , $version ) {
108+ function Publish-Framework-Dependent ($p ) {
110109
111- & $outputLocation \Flow-Launcher-Setup.exe -- silent | Out-Null
110+ $csproj = Join-Path " $p " " Flow.Launcher/Flow.Launcher.csproj" - Resolve
111+ $profile = Join-Path " $p " " Flow.Launcher/Properties/PublishProfiles/Net9.0-FrameworkDependent.pubxml" - Resolve
112+
113+ # we call dotnet publish on the main project.
114+ # The other projects should have been built in Release at this point.
115+ dotnet publish - c Release $csproj / p:PublishProfile= $profile
116+ }
117+
118+ function Publish-Portable ($outputLocation , $version , $suffix = " " ) {
119+
120+ & " $outputLocation \Flow-Launcher-Setup$suffix .exe" -- silent | Out-Null
112121 mkdir " $env: LocalAppData \FlowLauncher\app-$version \UserData"
113- Compress-Archive - Path $env: LocalAppData \FlowLauncher - DestinationPath $outputLocation \Flow- Launcher- Portable.zip
122+ Compress-Archive - Path $env: LocalAppData \FlowLauncher - DestinationPath " $outputLocation \Flow-Launcher-Portable$suffix .zip" - Force
123+ Remove-Item " $env: LocalAppData \FlowLauncher" - Recurse - Force
114124}
115125
116126function Main {
@@ -122,15 +132,22 @@ function Main {
122132
123133 Delete- Unused $p $config
124134
135+ # Build self-contained version (includes .NET runtime)
136+ Write-Host " Building self-contained version..."
125137 Publish-Self - Contained $p
126-
127138 Remove-CreateDumpExe $p $config
128139
129140 $o = " $p \Output\Packages"
130141 Validate- Directory $o
131142 Pack- Squirrel- Installer $p $v $o
132-
133143 Publish-Portable $o $v
144+
145+ # Build framework-dependent version (requires .NET runtime to be installed)
146+ Write-Host " Building framework-dependent version..."
147+ Publish-Framework - Dependent $p
148+ Remove-CreateDumpExe $p " Release-FD"
149+ Pack- Squirrel- Installer $p $v $o " $p \Output\Release-FD" " -FD"
150+ Publish-Portable $o $v " -FD"
134151 }
135152}
136153
0 commit comments