Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions chocolatey/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
$ErrorActionPreference = 'Stop'

$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$applicationName = "LogExpert"
$applicationPath = "$toolsDir\$applicationName.exe"

# create start menu shortcut only for current user
Install-ChocolateyShortcut -shortcutFilePath "$env:APPDATA\Microsoft\Windows\Start Menu\Programs\$applicationName.lnk" -targetpath $applicationPath

# create context menu entry only for current user
$registryKey = "Registry::HKEY_CURRENT_USER\SOFTWARE\Classes\*\shell\$applicationName"

if (Test-Path $registryKey) {
Remove-Item -Path $registryKey -Recurse
}

New-Item -Path $registryKey -Force | Out-Null
New-ItemProperty -Path $registryKey -Name "(Default)" -Value "Open with $applicationName" | Out-Null
New-ItemProperty -Path $registryKey -Name "Icon" -Value $applicationPath | Out-Null

$registryCommand = "$registryKey\command"
New-Item -Path $registryCommand | Out-Null
New-ItemProperty -Path $registryCommand -Name "(Default)" -Value "`"$applicationPath`" `"%1`"" | Out-Null
9 changes: 9 additions & 0 deletions chocolatey/tools/chocolateyuninstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
$ErrorActionPreference = 'Stop'

$applicationName = "LogExpert"

# remove start menu shortcut
Remove-Item "$env:APPDATA\Microsoft\Windows\Start Menu\Programs\$applicationName.lnk"

# remote context menu entry
Remove-Item -Path "Registry::HKEY_CURRENT_USER\SOFTWARE\Classes\*\shell\$applicationName" -Recurse