Skip to content
Draft
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
21 changes: 18 additions & 3 deletions installers/windows/console.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -329,13 +329,23 @@ Section "Console Application" SecApp
SectionEnd

Section "Start Menu Shortcuts" SecStartMenu
; Use the machine-wide config seed under ProgramData.
SetShellVarContext all
StrCpy $0 "$APPDATA\device-management-toolkit\config.yml"
SetShellVarContext current

CreateDirectory "$SMPROGRAMS\Device Management Toolkit"
CreateShortcut "$SMPROGRAMS\Device Management Toolkit\Console.lnk" "$INSTDIR\console.exe" "--tray"
CreateShortcut "$SMPROGRAMS\Device Management Toolkit\Console.lnk" "$INSTDIR\console.exe" "--tray --config $\"$0$\""
CreateShortcut "$SMPROGRAMS\Device Management Toolkit\Uninstall Console.lnk" "$INSTDIR\Uninstall.exe"
SectionEnd

Section "Desktop Shortcut" SecDesktop
CreateShortcut "$DESKTOP\DMT Console.lnk" "$INSTDIR\console.exe" "--tray"
; Use the machine-wide config seed under ProgramData.
SetShellVarContext all
StrCpy $0 "$APPDATA\device-management-toolkit\config.yml"
SetShellVarContext current

CreateShortcut "$DESKTOP\DMT Console.lnk" "$INSTDIR\console.exe" "--tray --config $\"$0$\""
SectionEnd

Section /o "Add to PATH" SecPath
Expand All @@ -355,8 +365,13 @@ Section /o "Add to PATH" SecPath
SectionEnd

Section /o "Run at Startup (System Tray)" SecStartup
; Use the machine-wide config seed under ProgramData.
SetShellVarContext all
StrCpy $0 "$APPDATA\device-management-toolkit\config.yml"
SetShellVarContext current

; Add to HKLM Run key so it launches with --tray on login
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "DMTConsole" '"$INSTDIR\console.exe" --tray'
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "DMTConsole" '"$INSTDIR\console.exe" --tray --config "$0"'

; Record that we added startup entry
WriteRegStr HKLM "Software\DeviceManagementToolkit\Console" "StartupInstalled" "1"
Expand Down
2 changes: 1 addition & 1 deletion services/console
Submodule console updated 1 files
+35 −4 pkg/tray/tray.go