-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve build script and update shortcut path
- 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.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |