diff --git a/.gitignore b/.gitignore index 71475ec..fc6ad69 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,4 @@ launcher/src/version.rc2 .vs/* .vscode .idea +.vagrant/ diff --git a/scripts/vagrantscript.ps1 b/scripts/vagrantscript.ps1 index 58a1c4a..f2303a2 100644 --- a/scripts/vagrantscript.ps1 +++ b/scripts/vagrantscript.ps1 @@ -29,7 +29,7 @@ $env:cmder_root = "C:/tools/cmder" write-host "Creating '${env:USERPROFILE}/Desktop/Cmder.lnk'..." start-process -NoNewWindow -filePath "$env:userprofile/bin/set-shortcut.ps1" -ArgumentList "-sourceexe `"$env:cmder_root\\Cmder.exe`" -DestinationPath `"${env:USERPROFILE}\\Desktop\\Cmder.lnk`" -WorkingDirectory `"${env:USERPROFILE}`"" -$env:cmder_root = ("${env:USERPROFILE}\\cmderdev" +$env:cmder_root = "${env:USERPROFILE}\\cmderdev" write-host "Creating '${env:USERPROFILE}\\Desktop\\Cmderdev.lnk'..." start-process -NoNewWindow -filePath "$env:userprofile\\bin\\set-shortcut.ps1" -ArgumentList "-sourceexe `"${env:cmder_root}\\Cmder.exe`" -DestinationPath `"${env:USERPROFILE}\\Desktop\\Cmderdev.lnk`" -WorkingDirectory `"${env:cmder_root}`"" diff --git a/vendor/bin/set-shortcut.ps1 b/vendor/bin/set-shortcut.ps1 new file mode 100644 index 0000000..7e0a8e9 --- /dev/null +++ b/vendor/bin/set-shortcut.ps1 @@ -0,0 +1,21 @@ +[CmdletBinding()] +param( + [Parameter()] + [string]$SourceExe, + [string]$Arguments, + [string]$DestinationPath, + [string]$WorkingDirectory, + [String]$IconLocation +) + +if ($IconLocation -eq '') { + $IconLocation = $SourceExe +} + +$WshShell = New-Object -comObject WScript.Shell +$Shortcut = $WshShell.CreateShortcut($destinationPath) +$Shortcut.TargetPath = $SourceExe +$Shortcut.Arguments = $Arguments +$shortcut.WorkingDirectory = $WorkingDirectory +$shortcut.IconLocation = $IconLocation +$Shortcut.Save()