Skip to content

Commit c90c147

Browse files
hovancikCopilot
andcommitted
Adds stretchly to PATH on Windows
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 1d02768 commit c90c147

5 files changed

Lines changed: 63 additions & 1 deletion

File tree

.github/copilot-instructions.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ You are a specialized assistant for developers working on Stretchly, a break-tim
1717
- Keep performance in mind, especially for background processes
1818
- Consider Chrome compatibility only, as Electron is built on Chromium
1919
- Use `npm run lint` to check for style issues
20+
- Never create git commits or push code without explicit instruction from the user
21+
- Always update `CHANGELOG.md` (under `[Unreleased]`) and relevant sections of `README.md` when making user-facing changes
2022

2123
## Code Organization
2224
- Respect the existing project structure
@@ -28,4 +30,4 @@ You are a specialized assistant for developers working on Stretchly, a break-tim
2830
- Suggest tests for new functionality
2931
- Consider edge cases in different operating systems
3032

31-
When developer asks about how something can be done, provide concise plan and explanations. Avoid unnecessary details. Do not start writing code until explicitly asked. When suggesting code changes, explain your reasoning and how they align with Stretchly's goals of promoting healthy computer use.
33+
When developer asks about how something can be done, provide concise plan and explanations. Avoid unnecessary details. Do not start writing code until explicitly asked. When suggesting code changes, explain your reasoning and how they align with Stretchly's goals of promoting healthy computer use.

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
66

77
## [Unreleased]
88
### Added
9+
- Windows installer now adds `stretchly` to PATH so CLI commands (e.g. `stretchly pause`) can be run from any terminal without specifying the full executable path
910
- advanced option `breakContentScreen` to show break countdown/idea only on the primary, cursor, or a specific screen while other screens stay blanked
1011
- advanced option `trayIconThemeSource` (`system`, `light`, or `dark`) to set the tray icon's light or dark variant
1112

build/installer.nsh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
!include "WinMessages.nsh"
2+
3+
!macro customInstall
4+
CreateDirectory "$INSTDIR\bin"
5+
ClearErrors
6+
FileOpen $0 "$INSTDIR\bin\stretchly.cmd" w
7+
${if} ${Errors}
8+
DetailPrint "Stretchly: failed to create CLI shim at $INSTDIR\bin\stretchly.cmd"
9+
${else}
10+
FileWrite $0 "@echo off$\r$\nsetlocal$\r$\nset $\"STRETCHLY_EXE=%~dp0..\Stretchly.exe$\"$\r$\ntasklist /FI $\"IMAGENAME eq Stretchly.exe$\" 2>NUL | find /I $\"Stretchly.exe$\" >NUL$\r$\nif errorlevel 1 ($\r$\n powershell -NoProfile -Command $\"Start-Process -FilePath $$env:STRETCHLY_EXE$\"$\r$\n) else ($\r$\n $\"%STRETCHLY_EXE%$\" %*$\r$\n)$\r$\n"
11+
FileClose $0
12+
${endif}
13+
14+
${if} $installMode == "all"
15+
EnVar::SetHKLM
16+
${else}
17+
EnVar::SetHKCU
18+
${endif}
19+
EnVar::AddValue "Path" "$INSTDIR\bin"
20+
Pop $0
21+
22+
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
23+
!macroend
24+
25+
!macro customUnInstall
26+
${ifNot} ${isUpdated}
27+
${if} $installMode == "all"
28+
EnVar::SetHKLM
29+
${else}
30+
EnVar::SetHKCU
31+
${endif}
32+
EnVar::DeleteValue "Path" "$INSTDIR\bin"
33+
Pop $0
34+
35+
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
36+
${endif}
37+
!macroend
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
zlib License
2+
3+
Originally coded by Jason Ross aka JasonFriday13 on the forums.
4+
5+
Copyright (C) 2014-2016, 2018 MouseHelmet Software
6+
Copyright (C) 2019-2020 Gilbertsoft LLC
7+
8+
This software is provided 'as-is', without any express or implied
9+
warranty. In no event will the authors be held liable for any damages
10+
arising from the use of this software.
11+
12+
Permission is granted to anyone to use this software for any purpose,
13+
including commercial applications, and to alter it and redistribute it
14+
freely, subject to the following restrictions:
15+
16+
1. The origin of this software must not be misrepresented; you must not
17+
claim that you wrote the original software. If you use this software
18+
in a product, an acknowledgment in the product documentation would be
19+
appreciated but is not required.
20+
2. Altered source versions must be plainly marked as such, and must not be
21+
misrepresented as being the original software.
22+
3. This notice may not be removed or altered from any source distribution.

build/x86-unicode/EnVar.dll

9 KB
Binary file not shown.

0 commit comments

Comments
 (0)