-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
package lang-fixer into an installer, attempt #1
- Loading branch information
Showing
5 changed files
with
176 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Python application | ||
|
||
on: | ||
push: | ||
paths: | ||
- "version.txt" | ||
branches: [$default_branch] | ||
paths-ignore: | ||
- "*.md" | ||
pull_request: | ||
branches: [$default_branch] | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pipenv | ||
pipenv install -d | ||
- name: Test with pytest | ||
run: | | ||
pipenv run pytest | ||
- name: Pyinstaller | ||
run: | | ||
pipenv run pyinstaller --onefile --noconsole lang-fixer.py | ||
- name: install NSIS` | ||
run: | | ||
Invoke-WebRequest -Uri 'https://prdownloads.sourceforge.net/nsis/nsis-3.08-setup.exe?download' -OutFile nsis-setup.exe | ||
nsis-setup.exe /S | ||
- name: build installer with nsis | ||
run: "C:\Program Files (x86)\NSIS\makensis.exe" lang-fixer.nsi | ||
-name: Release installer to GitHub | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: lang-fixer-installer*.exe | ||
- name: push new version tag | ||
id: tag_version | ||
uses: mathieudutour/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
custom_tag: v$(cat version.txt) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ pynput = "*" | |
[dev-packages] | ||
pytest = "*" | ||
autopep8 = "*" | ||
pyinstaller = "*" | ||
|
||
[requires] | ||
python_version = "3.9" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
InstallDir "$PROGRAMFILES\lang-fixer" | ||
Name "lang-fixer" | ||
|
||
; Read version | ||
FileOpen $VersionFile "version.txt" r | ||
FileRead $VersionFile $VERSION ; Read until the end of line (including carriage return and new line) and save it to $VERSION | ||
FileClose $VersionFile ; and close the file | ||
|
||
outFile "lang-fixer-installer_v${VERSION}.exe" | ||
|
||
Page directory | ||
Page instfiles | ||
|
||
Section "install" | ||
setOutPath $INSTDIR | ||
|
||
file -oname "lang-fixer.exe" ".\dist\lang-fixer.exe" | ||
file "settings.json" | ||
file "layout1.txt" | ||
file "layout2.txt" | ||
|
||
writeRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "lang-fixer" "$INSTDIR\lang-fixer.exe" | ||
|
||
writeUninstaller "$INSTDIR\uninstall.exe" | ||
writeRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\lang-fixer" "DisplayName" "lang-fixer" | ||
writeRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\lang-fixer" "DisplayVersion" "$VERSION" | ||
writeRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\lang-fixer" "UninstallString" "$\"$INSTDIR\uninstall.exe$\"" | ||
writeRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\lang-fixer" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S" | ||
writeRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\lang-fixer" "InstallLocation" "$INSTDIR" | ||
writeRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\lang-fixer" "Publisher" "TheYarin" | ||
writeRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\lang-fixer" "HelpLink" "https://github.com/TheYarin/lang-fixer" | ||
writeRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\lang-fixer" "Readme" "https://github.com/TheYarin/lang-fixer" | ||
writeRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\lang-fixer" "NoModify" 1 | ||
writeRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\lang-fixer" "NoRepair" 1 | ||
|
||
${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2 | ||
IntFmt $0 "0x%08X" $0 | ||
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\lang-fixer" "EstimatedSize" "$0" | ||
|
||
SectionEnd | ||
|
||
function un.onInit | ||
SetShellVarContext all | ||
|
||
#Verify the uninstaller - last chance to back out | ||
MessageBox MB_OKCANCEL "Permanently remove lang-fixer?" IDOK next | ||
Abort | ||
next: | ||
!insertmacro VerifyUserIsAdmin | ||
functionEnd | ||
|
||
section "uninstall" | ||
Delete "$INSTDIR\lang-fixer.exe" | ||
|
||
MessageBox MB_YESNO "Would you like to delete even the settings and the keyboard layouts configured?" /SD IDYES lbl_delete_configs IDNO lbl_skip | ||
|
||
lbl_delete_configs: | ||
Delete $INSTDIR\settings.json | ||
Delete $INSTDIR\layout1.txt | ||
Delete $INSTDIR\layout2.txt | ||
|
||
lbl_skip: | ||
|
||
Delete $INSTDIR\uninstall.exe | ||
|
||
rmdir $INSTDIR | ||
|
||
DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "lang-fixer" | ||
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\lang-fixer" | ||
sectionEnd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0.1.0 |