diff --git a/README.md b/README.md index b7ecab8..01fc146 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,14 @@ Release zips are written to: builds/releases/ ``` +## Config Files + +`config.json` is local runtime data and is ignored by Git. Keep your personal launcher menu there for testing. + +`config.example.json` is a public-safe sample config for documentation and reference. New users do not need to copy it; if `config.json` is missing, the app creates a clean starter config on first run. + +Personal test configs should stay in `config.json`; release packages do not include it unless the release script is run with `-IncludeCurrentConfig`. + ## Versioning The app version is controlled in `TaskbarLauncher.csproj`. diff --git a/Services/IconService.cs b/Services/IconService.cs index 8bffac6..87a637c 100644 --- a/Services/IconService.cs +++ b/Services/IconService.cs @@ -52,6 +52,8 @@ public static class IconService return null; } + path = Environment.ExpandEnvironmentVariables(path); + try { uint flags = ShgfiIcon | (large ? ShgfiLargeIcon : ShgfiSmallIcon); diff --git a/Services/LauncherController.cs b/Services/LauncherController.cs index 014e479..6923cb4 100644 --- a/Services/LauncherController.cs +++ b/Services/LauncherController.cs @@ -95,12 +95,14 @@ public sealed class LauncherController : IDisposable return; } + string target = Environment.ExpandEnvironmentVariables(item.Target); + ProcessStartInfo startInfo = new() { - FileName = item.Target, + FileName = target, Arguments = item.Arguments ?? "", UseShellExecute = true, - WorkingDirectory = Directory.Exists(item.Target) ? item.Target : ConfigService.AppFolder + WorkingDirectory = Directory.Exists(target) ? target : ConfigService.AppFolder }; Process.Start(startInfo); diff --git a/TaskbarLauncher.csproj b/TaskbarLauncher.csproj index 364345c..0013e36 100644 --- a/TaskbarLauncher.csproj +++ b/TaskbarLauncher.csproj @@ -7,7 +7,7 @@ enable true true - $(DefaultItemExcludes);bin\**;obj\**;..\TaskbarLauncher-build\** + $(DefaultItemExcludes);bin\**;obj\**;builds\**;_*\**;..\TaskbarLauncher-build\** 1.0.0 1.0.0.0 1.0.0.0 diff --git a/config.example.json b/config.example.json new file mode 100644 index 0000000..93055a7 --- /dev/null +++ b/config.example.json @@ -0,0 +1,53 @@ +{ + "Hotkey": "Ctrl+Alt+Space", + "DisplayMode": "CompactList", + "Items": [ + { + "Title": "Folders", + "Type": "Menu", + "Target": "", + "Arguments": null, + "IconPath": null, + "DisplayMode": "CompactList", + "Children": [ + { + "Title": "Documents", + "Type": "Folder", + "Target": "%USERPROFILE%\\Documents", + "Arguments": null, + "IconPath": "%USERPROFILE%\\Documents", + "DisplayMode": "CompactList", + "Children": [] + }, + { + "Title": "Downloads", + "Type": "Folder", + "Target": "%USERPROFILE%\\Downloads", + "Arguments": null, + "IconPath": "%USERPROFILE%\\Downloads", + "DisplayMode": "CompactList", + "Children": [] + } + ] + }, + { + "Title": "Apps", + "Type": "Menu", + "Target": "", + "Arguments": null, + "IconPath": null, + "DisplayMode": "CompactList", + "Children": [ + { + "Title": "Notepad", + "Type": "App", + "Target": "notepad.exe", + "Arguments": null, + "IconPath": "notepad.exe", + "DisplayMode": "CompactList", + "Children": [] + } + ] + } + ] +} diff --git a/docs/INSTALL.md b/docs/INSTALL.md index a493d4b..311e61b 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -45,3 +45,9 @@ config.json Keep `config.json` beside `TaskbarLauncher.exe`. If `config.json` is missing, the app creates a clean starter config on first run. + +## Example Config + +The source repository includes `config.example.json` as a public-safe example. It is not required for normal installation. + +Paths in config may use Windows environment variables such as `%USERPROFILE%`.