Skip to content

Commit

Permalink
improve build script and update shortcut path
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Hübner committed Dec 11, 2019
1 parent 47b572c commit bba9925
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
$buildPath = 'C:\SeeSharp\win10\x64'
$pagesPath = Join-Path -Path $buildPath -ChildPath '\pages'
$documentsPath = [Environment]::GetFolderPath("MyDocuments")
$pagesPath = Join-Path $documentsPath -ChildPath SeeSharp | Join-Path -ChildPath pages
Write-Host $pagesPath -ForegroundColor Green


#exit
### build App
Write-Host "BUILDING APP" -ForegroundColor Green
Write-Host "================= BUILDING APP =================" -ForegroundColor Green
cd SeeSharp.Desktop
dotnet publish -o $buildPath -c RELEASE -f netcoreapp3.0 -r win10-x64 /p:PublishSingleFile=true /p:IncludeSymbolsInSingleFile=true
cd ..

### Create 'Send to > SeeSharp' shortcut
Write-Host "CREATING 'Send to > SeeSharp' SHORTCUT" -ForegroundColor Green
Write-Host "==== CREATING 'Send to > SeeSharp' SHORTCUT ====" -ForegroundColor Green
$wshshell = New-Object -com wscript.shell

$shortcutPath = Join-Path -Path $wshshell.SpecialFolders.Item('sendto') -ChildPath 'SeeSharp.lnk'
$shortcut = $wshshell.CreateShortcut($shortcutPath)
$shortcut.TargetPath = $pagesPath
$shortcut.Description = 'this shortcut was created by SeeSharp'
$shortcut.Save()
if((Test-Path $shortcutPath)){
Write-Host " shortcut already set" -ForegroundColor Green
}
else{
$shortcut = $wshshell.CreateShortcut($shortcutPath)
$shortcut.TargetPath = $pagesPath
$shortcut.Description = 'this shortcut was created by SeeSharp'
$shortcut.Save()
Write-Host " shortcut created" -ForegroundColor Green
}

Write-Host "ALL DONE!" -ForegroundColor Green
Write-Host "================== ALL DONE! ===================" -ForegroundColor Green

0 comments on commit bba9925

Please sign in to comment.