setlocal enableDelayedExpansion
IF NOT DEFINED PTRoot (SET PTRoot=..\..)
rem Publish Settings
SET settingsProfileFolderName=!PTRoot!\src\core\Microsoft.PowerToys.Settings.UI.Runner\Properties\PublishProfiles\
rem Create the publish profile folder if it doesn't exist
IF NOT EXIST !settingsProfileFolderName! (mkdir !settingsProfileFolderName!)
SET settingsProfileFileName=SettingsProfile.pubxml
SET settingsPublishProfile=!settingsProfileFolderName!!settingsProfileFileName!
rem Create the publish profile pubxml
echo ^ > !settingsPublishProfile!
echo ^<^^!-- >> !settingsPublishProfile!
echo https://go.microsoft.com/fwlink/?LinkID=208121. >> !settingsPublishProfile!
echo --^> >> !settingsPublishProfile!
echo ^ >> !settingsPublishProfile!
echo ^ >> !settingsPublishProfile!
echo ^FileSystem^ >> !settingsPublishProfile!
echo ^Release^ >> !settingsPublishProfile!
echo ^x64^ >> !settingsPublishProfile!
echo ^netcoreapp3.1^ >> !settingsPublishProfile!
echo ^..\..\..\x64\Release\SettingsUIRunner^ >> !settingsPublishProfile!
echo ^win-x64^ >> !settingsPublishProfile!
echo ^false^ >> !settingsPublishProfile!
echo ^False^ >> !settingsPublishProfile!
echo ^False^ >> !settingsPublishProfile!
echo ^ >> !settingsPublishProfile!
echo ^ >> !settingsPublishProfile!
rem In case of Release we should not use Debug CRT in VCRT forwarders
msbuild !PTRoot!\src\core\Microsoft.PowerToys.Settings.UI.Runner\Microsoft.PowerToys.Settings.UI.Runner.csproj -t:Publish -p:Configuration="Release" -p:Platform="x64" -p:AppxBundle=Never -p:VCRTForwarders-IncludeDebugCRT=false -p:PublishProfile=!settingsProfileFileName!
rem Publish Launcher
SET launcherProfileFolderName=!PTRoot!\src\modules\launcher\PowerLauncher\Properties\PublishProfiles\
rem Create the publish profile folder if it doesn't exist
IF NOT EXIST !launcherProfileFolderName! (mkdir !launcherProfileFolderName!)
SET launcherProfileFileName=LauncherProfile.pubxml
SET launcherPublishProfile=!launcherProfileFolderName!!launcherProfileFileName!
rem Create the publish profile pubxml
echo ^ > !launcherPublishProfile!
echo ^<^^!-- >> !launcherPublishProfile!
echo https://go.microsoft.com/fwlink/?LinkID=208121. >> !launcherPublishProfile!
echo --^> >> !launcherPublishProfile!
echo ^ >> !launcherPublishProfile!
echo ^ >> !launcherPublishProfile!
echo ^FileSystem^ >> !launcherPublishProfile!
echo ^Release^ >> !launcherPublishProfile!
echo ^x64^ >> !launcherPublishProfile!
echo ^netcoreapp3.1^ >> !launcherPublishProfile!
echo ^..\..\..\..\x64\Release\modules\launcher^ >> !launcherPublishProfile!
echo ^win-x64^ >> !launcherPublishProfile!
echo ^false^ >> !launcherPublishProfile!
echo ^False^ >> !launcherPublishProfile!
echo ^False^ >> !launcherPublishProfile!
echo ^ >> !launcherPublishProfile!
echo ^ >> !launcherPublishProfile!
rem In case of Release we should not use Debug CRT in VCRT forwarders
msbuild !PTRoot!\src\modules\launcher\PowerLauncher\PowerLauncher.csproj -t:Publish -p:Configuration="Release" -p:Platform="x64" -p:AppxBundle=Never -p:VCRTForwarders-IncludeDebugCRT=false -p:PublishProfile=!launcherProfileFileName!