Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inno6 installer #31

Open
wants to merge 35 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
e0217c2
initial attempt
willwade Jun 27, 2023
cd57d88
runas admin version
willwade Jun 27, 2023
7f5d322
creating inno6 version of our build gh action
willwade Jun 27, 2023
40705fb
updating requirements
willwade Jun 27, 2023
4c0a671
mysetup -> projectGameface Installer
willwade Jun 27, 2023
2dc590f
adding readme details
willwade Jun 27, 2023
7bb3107
Update windows-build-release.yml
willwade Jun 27, 2023
417da76
reverting to installer name
willwade Jun 27, 2023
9d99616
Merge branch 'inno6-installer' of https://github.com/willwade/project…
willwade Jun 27, 2023
8c2f71e
reverting binary name
willwade Jun 27, 2023
9392ad0
trying diff way of doing name
willwade Jun 27, 2023
fa17bd6
a fix for #7
willwade Jun 27, 2023
9225d13
migrating config saving to C:/Users/<USER_NAME>/Gameface/
willwade Jun 28, 2023
0c4dcc7
fixing location of path for binary
willwade Jun 28, 2023
716ca97
fixing color?
willwade Jun 28, 2023
70e95e1
fixing verrsion to latest for customtkinter
willwade Jun 28, 2023
2b196a1
add icon for app
willwade Jun 28, 2023
c23b1a1
fiximg issues with fgcolor
willwade Jun 28, 2023
970bd16
reputting in correct name of app
willwade Jun 28, 2023
552879b
testing log path to Gameface user dir
willwade Jun 28, 2023
13f73b1
stupid typo
willwade Jun 28, 2023
9212f7d
gah had reverted the switch color bug
willwade Jun 28, 2023
22a1490
build portable and autostart
willwade Jun 29, 2023
11612e0
adding portable build
willwade Jun 29, 2023
fdb2227
stupid typo
willwade Jun 29, 2023
701dff2
clearer sections for zipping
willwade Jun 29, 2023
7cb0bfd
see if shell: pwsh fixes things
willwade Jun 29, 2023
4a136f4
swap installer and portable
willwade Jun 29, 2023
a60eba5
d'oh! its a zip not a exe
willwade Jun 29, 2023
5846347
one last thing
willwade Jun 29, 2023
6ad7452
unchecking desktop defaults
willwade Jun 30, 2023
d94dbbd
Update src/config_manager.py
willwade Nov 13, 2023
dbeda43
Update README.md
willwade Nov 13, 2023
4054ea8
putting back in missing actions
willwade Nov 13, 2023
31590c7
Merge branch 'inno6-installer' of https://github.com/willwade/project…
willwade Nov 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/windows-build-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
on:
workflow_dispatch:
push:
branches:
- master
- inno6-installer
pull_request:

jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Freeze Installer
run: |
pyinstaller build.spec
- name: Build Installer
run: |
iscc installer.iss
- name: Freeze Portable
run: |
pyinstaller --distpath dist-portable build-portable.spec
- name: Zip Portable
shell: pwsh
run: |
Copy-Item -Path assets -Destination dist-portable\ -Recurse
Copy-Item -Path configs -Destination dist-portable\ -Recurse
Compress-Archive -Path dist-portable -DestinationPath GameFacePortable.zip
- name: Upload installer
uses: actions/upload-artifact@v3
with:
name: 'Windows Installer Release'
path: '\a\project-gameface\project-gameface\Output\GameFace Installer.exe'
- name: Upload portable
uses: actions/upload-artifact@v3
with:
name: 'Windows Portable Release'
path: '\a\project-gameface\project-gameface\GameFacePortable.zip'
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,20 @@ Project Gameface helps gamers control their mouse cursor using their head moveme



# Download
# Download

## Single portable directory

1. Download the program from [Release section](../../releases/)
2. Run `run_app.exe`


## Installer

1. Download the Gameface-Installer.exe from [Release section](../../releases/)
2. Install it
3. Run from your Windows shortucts/desktop


# Model used
MediaPipe Face Landmark Detection API [Task Guide](https://developers.google.com/mediapipe/solutions/vision/face_landmarker)
Expand All @@ -31,7 +40,7 @@ MediaPipe Face Landmark Detection API [Task Guide](https://developers.google.com
## Installation
> Environment
>- Windows
>- Python 3.9
>- Python 3.10
```
pip install -r requirements.txt
```
Expand Down Expand Up @@ -88,7 +97,13 @@ gesture_name: [device_name, action_name, threshold, trigger_type]


# Build

## Pyinstaller / Frozen app
```
pyinstaller build.spec
```

# Build Installer

1. Install [inno6](https://jrsoftware.org/isdl.php#stable)
2. Build using the `installer.iss` file
2 changes: 1 addition & 1 deletion assets/themes/google_theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"corner_radius": 500,
"border_width": 0,
"button_length": 0,
"fg_Color": ["#444746", "#4A4D50"],
"fg_color": ["#444746", "#4A4D50"],
"progress_color": ["#64DD17", "#1f538d"],
"button_color": ["#8F8F8F", "#D5D9DE"],
"button_hover_color": ["gray20", "gray100"],
Expand Down
57 changes: 57 additions & 0 deletions build-portable.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# -*- mode: python ; coding: utf-8 -*-

from pathlib import Path
import mediapipe
import customtkinter

block_cipher = None

mp_init = Path(mediapipe.__file__)
mp_modules = Path(mp_init.parent,"modules")

ctk_init = Path(customtkinter.__file__)
ctk_modules = Path(ctk_init.parent,"modules")



app = Analysis(
['run_app.py'],
pathex=[],
binaries=[],
datas=[(mp_modules.as_posix(), 'mediapipe/modules'),
('assets','assets'),
('configs','configs'),
(ctk_init.parent.as_posix(), 'customtkinter')],
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False,
)
pyz_app = PYZ(app.pure, app.zipped_data, cipher=block_cipher)

exe = EXE(
pyz_app,
app.scripts,
app.binaries,
app.zipfiles,
app.datas,
[],
name='run_app',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
runtime_tmpdir=None,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon='assets/images/icon.ico',
)
1 change: 1 addition & 0 deletions build.spec
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ exe_app = EXE(
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
icon='assets/images/icon.ico',
codesign_identity=None,
entitlements_file=None,
)
Expand Down
46 changes: 46 additions & 0 deletions installer.iss
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Gameface"
#define MyAppVersion "1"
#define MyAppExeName "run_app.exe"

[Setup]
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{B266B614-4113-4DB7-9A30-4250FECA5009}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
DefaultDirName={autopf}\{#MyAppName}
DisableProgramGroupPage=yes
; Uncomment the following line to run in non administrative install mode (install for current user only.)
;PrivilegesRequired=lowest
OutputBaseFilename=GameFace Installer
SetupIconFile=assets\images\icon.ico
Compression=lzma
SolidCompression=yes
WizardStyle=modern

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}";
Name: "autostarticon"; Description: "{cm:AutoStartProgram,{#MyAppName}}"; GroupDescription: "{cm:AdditionalIcons}";


[Files]
Source: "dist\project_gameface\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "dist\project_gameface\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
Name: "{userstartup}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Parameters: "/auto"; Tasks: autostarticon
; Name: "{commonstartup}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Parameters: "/auto"; Tasks: autostarticon

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Verb: runas; Flags: postinstall skipifsilent shellexec runascurrentuser waituntilterminated;

9 changes: 5 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ matplotlib==3.7.1
opencv-contrib-python==4.7.0.72
psutil==5.9.4
pyautogui==0.9.53
customtkinter==5.1.2
PyDirectInput==1.0.4
pywin32==306
mediapipe==0.9.3.0
customtkinter==5.2.0
mediapipe==0.9.3.0
PyDirectInput==1.0.4; sys_platform == 'win32'
pywin32==306; sys_platform == 'win32'
pyinstaller==5.11.0
21 changes: 14 additions & 7 deletions run_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,30 @@

import logging
import sys
import os
import customtkinter

import src.gui as gui
from src.task_killer import TaskKiller
from src.pipeline import Pipeline

FORMAT = "%(asctime)s %(levelname)s %(name)s: %(funcName)s: %(message)s"
logging.basicConfig(format=FORMAT,
level=logging.INFO,
handlers=[
logging.FileHandler("log.txt", mode='w'),
logging.StreamHandler(sys.stdout)
])

log_path = os.environ['USERPROFILE']+'\Gameface'
if not os.path.isdir(log_path):
os.mkdir(log_path)

logging.basicConfig(
format=FORMAT,
level=logging.INFO,
handlers=[
logging.FileHandler(log_path+'\log.txt', mode="w"),
logging.StreamHandler(sys.stdout),
],
)

class MainApp(gui.MainGui, Pipeline):

class MainApp(gui.MainGui, Pipeline):
def __init__(self, tk_root):
super().__init__(tk_root)
# Wait for window drawing.
Expand Down
13 changes: 11 additions & 2 deletions src/config_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,28 @@
import tkinter as tk
import time
import shutil
import os
from pathlib import Path

from src.singleton_meta import Singleton
from src.task_killer import TaskKiller

VERSION = "0.3.30"

DEFAULT_JSON = Path("configs/default.json")
BACKUP_PROFILE = Path("configs/default")
DEFAULT_JSON = Path(f"C:/Users/{os.getlogin()}/Gameface/configs/default.json")
BACKUP_PROFILE = Path(f"C:/Users/{os.getlogin()}/Gameface/configs/default")

logger = logging.getLogger("ConfigManager")


if not os.path.isdir(f"C:/Users/{os.getlogin()}/Gameface/configs/"):
shutil.copytree("configs", f"C:/Users/{os.getlogin()}/Gameface/configs/")
os.mkdir(f"C:/Users/{os.getlogin()}/Gameface/configs/")

if not os.path.isdir(f"C:/Users/{os.getlogin()}/Gameface/configs/default"):
os.mkdir(f"C:/Users/{os.getlogin()}/Gameface/configs/default")


class ConfigManager(metaclass=Singleton):

def __init__(self):
Expand Down
2 changes: 1 addition & 1 deletion src/gui/pages/page_select_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def __init__(self, master, **kwargs):
self.label.grid(row=1, column=0, padx=10, pady=(20, 10), sticky="nw")

# Empty radio buttons
self.radio_var = tkinter.IntVar(0)
self.radio_var = tkinter.IntVar(value=0)
self.prev_radio_value = None
self.radios = []

Expand Down