-
Notifications
You must be signed in to change notification settings - Fork 7
/
install.ps1
34 lines (28 loc) · 1.39 KB
/
install.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
$currentDir = split-path -parent $MyInvocation.MyCommand.Definition
$hstwbInstallerIconFile = Join-Path $currentDir -ChildPath 'hstwb_installer.ico'
$objShell = New-Object -ComObject WScript.Shell
# install launcher.lnk shortcut
$launcherLinkFile = Join-Path $currentDir -ChildPath 'launcher.lnk'
$launcherLink = $objShell.CreateShortcut($launcherLinkFile)
$launcherLink.WorkingDirectory = $currentDir
$launcherLink.IconLocation = "{0},0" -f $hstwbInstallerIconFile
$launcherLink.Save()
# install setup.lnk shortcut
$setupLinkFile = Join-Path $currentDir -ChildPath 'setup.lnk'
$setupLink = $objShell.CreateShortcut($setupLinkFile)
$setupLink.WorkingDirectory = $currentDir
$setupLink.IconLocation = "{0},0" -f $hstwbInstallerIconFile
$setupLink.Save()
# install run.lnk shortcut
$runLinkFile = Join-Path $currentDir -ChildPath 'run.lnk'
$runLink = $objShell.CreateShortcut($runLinkFile)
$runLink.WorkingDirectory = $currentDir
$runLink.IconLocation = "{0},0" -f $hstwbInstallerIconFile
$runLink.Save()
# install fonts
$fonts = 0x14
$objShell = New-Object -ComObject Shell.Application
$objFolder = $objShell.Namespace($fonts)
$systemFontsDir = $objFolder.Self.Path
$fontsDir = Join-Path $currentDir -ChildPath 'fonts'
Get-ChildItem -Path $fontsDir *.ttf | Where-Object { !(Test-Path (Join-Path $systemFontsDir -ChildPath $_.Name)) } | ForEach-Object { $objFolder.CopyHere($_.FullName) }