Compare commits
2 Commits
d7100e6f2a
...
driver_ui
| Author | SHA1 | Date | |
|---|---|---|---|
| ebcc485f51 | |||
| c09b3f3f66 |
@@ -0,0 +1,12 @@
|
|||||||
|
CC = i686-w64-mingw32-gcc
|
||||||
|
CFLAGS = -O2 -Wall -D_WIN32_WINNT=0x0501 -mwindows
|
||||||
|
LDFLAGS = -lwinhttp
|
||||||
|
TARGET = driver_xp.exe
|
||||||
|
|
||||||
|
all: $(TARGET)
|
||||||
|
|
||||||
|
$(TARGET): driver_xp.c
|
||||||
|
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(TARGET)
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
# Windows XP Driver UI
|
||||||
|
|
||||||
|
This project is a native Win32 application built for Windows XP compatibility.
|
||||||
|
It avoids .NET and WinForms completely and targets a classic Windows API implementation instead.
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- Login form for driver authentication
|
||||||
|
- Calls the existing auth API on 192.168.68.66:5000
|
||||||
|
- Fetches the daily schedule from 192.168.68.66:5001
|
||||||
|
- Works with Windows XP and older native Windows systems
|
||||||
|
- Uses the WinHTTP API, which is available on XP
|
||||||
|
|
||||||
|
## Build
|
||||||
|
|
||||||
|
```bash
|
||||||
|
make
|
||||||
|
```
|
||||||
|
|
||||||
|
This uses the MinGW cross-compiler targeting 32-bit Windows.
|
||||||
|
|
||||||
|
## Runtime requirements
|
||||||
|
|
||||||
|
The app expects the following services to be available:
|
||||||
|
|
||||||
|
- auth_api on http://192.168.68.66:5000
|
||||||
|
- transit_api on http://192.168.68.66:5001
|
||||||
|
|
||||||
|
The app intentionally points at the live network host instead of localhost so it works on a Windows XP machine connected to the same LAN.
|
||||||
|
|
||||||
|
## Installer
|
||||||
|
|
||||||
|
A custom Windows installer is the distribution package for XP-era machines. The executable is bundled inside the installer; distribute `TransitDriverXPSetup.exe` rather than the internal `driver_xp.exe`.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
makensis installer.nsi
|
||||||
|
```
|
||||||
|
|
||||||
|
This creates `TransitDriverXPSetup.exe`, which installs:
|
||||||
|
|
||||||
|
- `driver_xp.exe`
|
||||||
|
- `README.md`
|
||||||
|
- Start menu shortcut
|
||||||
|
- Desktop shortcut
|
||||||
|
- Uninstaller entry
|
||||||
|
|
||||||
|
When run on a machine with an existing Transit Driver XP installation, the installer
|
||||||
|
reuses the saved installation directory, stops the previous app if it is running,
|
||||||
|
and replaces the installed files with the new version. Existing shortcuts remain in
|
||||||
|
place and point to the updated app.
|
||||||
|
|
||||||
|
The installer is designed for test deployment on a real Windows XP or older Windows machine compatible with native Win32 executables.
|
||||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Executable
BIN
Binary file not shown.
@@ -0,0 +1,76 @@
|
|||||||
|
; Transit Driver XP custom installer
|
||||||
|
!include "MUI2.nsh"
|
||||||
|
!include "WinVer.nsh"
|
||||||
|
|
||||||
|
!define APPNAME "Transit Driver XP"
|
||||||
|
!define COMPANYNAME "Transit Project"
|
||||||
|
!define DESCRIPTION "Native Windows XP-compatible driver app"
|
||||||
|
!define VERSIONMAJOR 1
|
||||||
|
!define VERSIONMINOR 1
|
||||||
|
!define VERSIONBUILD 0
|
||||||
|
|
||||||
|
Name "${APPNAME}"
|
||||||
|
OutFile "TransitDriverXPSetup.exe"
|
||||||
|
InstallDir "$PROGRAMFILES\TransitDriverXP"
|
||||||
|
InstallDirRegKey HKCU "Software\TransitDriverXP" "InstallDir"
|
||||||
|
RequestExecutionLevel admin
|
||||||
|
|
||||||
|
VIProductVersion "${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONBUILD}.0"
|
||||||
|
VIAddVersionKey "ProductName" "${APPNAME}"
|
||||||
|
VIAddVersionKey "CompanyName" "${COMPANYNAME}"
|
||||||
|
VIAddVersionKey "LegalCopyright" "Transit Project"
|
||||||
|
VIAddVersionKey "FileDescription" "${DESCRIPTION}"
|
||||||
|
VIAddVersionKey "FileVersion" "${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONBUILD}"
|
||||||
|
VIAddVersionKey "ProductVersion" "${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONBUILD}"
|
||||||
|
|
||||||
|
Function .onInit
|
||||||
|
ReadRegStr $0 HKCU "Software\TransitDriverXP" "InstallDir"
|
||||||
|
StrCmp $0 "" done
|
||||||
|
|
||||||
|
IfFileExists "$0\driver_xp.exe" 0 done
|
||||||
|
StrCpy $INSTDIR $0
|
||||||
|
MessageBox MB_OK|MB_ICONINFORMATION "An existing Transit Driver XP installation was found. It will be updated in $INSTDIR."
|
||||||
|
|
||||||
|
; Release the old executable before NSIS replaces it.
|
||||||
|
ExecWait '"$SYSDIR\taskkill.exe" /F /IM driver_xp.exe'
|
||||||
|
|
||||||
|
done:
|
||||||
|
FunctionEnd
|
||||||
|
|
||||||
|
!insertmacro MUI_PAGE_DIRECTORY
|
||||||
|
!insertmacro MUI_PAGE_INSTFILES
|
||||||
|
!insertmacro MUI_LANGUAGE "English"
|
||||||
|
|
||||||
|
Section "Install"
|
||||||
|
SetOutPath "$INSTDIR"
|
||||||
|
SetOverwrite on
|
||||||
|
File "driver_xp.exe"
|
||||||
|
File "README.md"
|
||||||
|
|
||||||
|
WriteRegStr HKCU "Software\TransitDriverXP" "InstallDir" "$INSTDIR"
|
||||||
|
WriteRegStr HKCU "Software\TransitDriverXP" "DisplayName" "${APPNAME}"
|
||||||
|
|
||||||
|
CreateDirectory "$SMPROGRAMS\TransitDriverXP"
|
||||||
|
CreateShortCut "$SMPROGRAMS\TransitDriverXP\Transit Driver XP.lnk" "$INSTDIR\driver_xp.exe"
|
||||||
|
CreateShortCut "$DESKTOP\Transit Driver XP.lnk" "$INSTDIR\driver_xp.exe"
|
||||||
|
|
||||||
|
WriteUninstaller "$INSTDIR\Uninstall.exe"
|
||||||
|
CreateShortCut "$SMPROGRAMS\TransitDriverXP\Uninstall Transit Driver XP.lnk" "$INSTDIR\Uninstall.exe"
|
||||||
|
|
||||||
|
; launch after install
|
||||||
|
ExecShell "open" "$INSTDIR\driver_xp.exe"
|
||||||
|
SectionEnd
|
||||||
|
|
||||||
|
Section "Uninstall"
|
||||||
|
Delete "$DESKTOP\Transit Driver XP.lnk"
|
||||||
|
Delete "$SMPROGRAMS\TransitDriverXP\Transit Driver XP.lnk"
|
||||||
|
Delete "$SMPROGRAMS\TransitDriverXP\Uninstall Transit Driver XP.lnk"
|
||||||
|
RMDir "$SMPROGRAMS\TransitDriverXP"
|
||||||
|
|
||||||
|
Delete "$INSTDIR\driver_xp.exe"
|
||||||
|
Delete "$INSTDIR\README.md"
|
||||||
|
Delete "$INSTDIR\Uninstall.exe"
|
||||||
|
RMDir "$INSTDIR"
|
||||||
|
|
||||||
|
DeleteRegKey HKCU "Software\TransitDriverXP"
|
||||||
|
SectionEnd
|
||||||
Reference in New Issue
Block a user