This repository has been archived by the owner on Jun 19, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make a windows installer that works on both 32 and 64 bit
- Loading branch information
1 parent
0664e7d
commit cd5af65
Showing
6 changed files
with
144 additions
and
32 deletions.
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 |
---|---|---|
@@ -1,20 +1,20 @@ | ||
Copyright (c) 2015 Jack Humbert | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
Copyright (c) 2015 Jack Humbert | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file was deleted.
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,10 @@ | ||
# What it takes to get this working on windows | ||
|
||
1. Install the software | ||
2. During installation you will be asked if you wish to install the driver | ||
from Atmel. Click Install. | ||
3. Plug your keyboard in, press RESET | ||
4. Wait while windows tries to find a driver in Windows Update. You can | ||
tell it to skip this but you'll still wait 5-10 minutes while it | ||
searches Windows Update. | ||
5. Run Firmware Flasher |
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 |
---|---|---|
@@ -1,13 +1,17 @@ | ||
#!/bin/sh | ||
# Build a distributable windows package | ||
# Build a distributable windows package on a Linux or OS X host | ||
# | ||
# Once you have built this copy the zip file to a windows host with NSIS | ||
# installed and use firmware_flasher.win32.nsi to build a .exe installer. | ||
set -x | ||
|
||
plat=win32 | ||
arch=x64 | ||
arch=ia32 | ||
output_dir=~/"QMK Firmware Flasher" | ||
package_dir="QMK Firmware Flasher-$plat-$arch" | ||
zip_file="${package_dir}.zip" | ||
|
||
rm -r "$output_dir/$package_dir" "$zip_file" | ||
electron-packager . --platform=$plat --arch=$arch --out "$output_dir" --prune | ||
cp firmware_flasher.win32.nsi "${output_dir}/${package_dir}" | ||
( cd "$output_dir" && zip -r "$zip_file" "$package_dir" ) |
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,107 @@ | ||
# This installs QMK, creates a start menu shortcut, builds an uninstaller, and | ||
# adds uninstall information to the registry for Add/Remove Programs | ||
|
||
# All the settings can be tweaked by editing the !defines at the top of this script | ||
!define APPNAME "Firmware Flasher" | ||
!define COMPANYNAME "QMK" | ||
!define DESCRIPTION "Flash atmega32u4 devices over DFU." | ||
# These three must be integers | ||
!define VERSIONMAJOR 0 | ||
!define VERSIONMINOR 5 | ||
!define VERSIONBUILD 0 | ||
# These will be displayed by the "Click here for support information" link in "Add/Remove Programs" | ||
# It is possible to use "mailto:" links in here to open the email client | ||
!define HELPURL "https://github.com/jackhumbert/dfu-programmer-app/issues" # "Support Information" link | ||
!define UPDATEURL "https://github.com/jackhumbert/dfu-programmer-app/releases" # "Product Updates" link | ||
!define ABOUTURL "https://github.com/jackhumbert/dfu-programmer-app" # "Publisher" link | ||
|
||
# This is the size (in kB) of all the files copied into "Program Files" | ||
#!define INSTALLSIZE 7233 | ||
|
||
RequestExecutionLevel admin ;Require admin rights on NT6+ (When UAC is turned on) | ||
|
||
InstallDir "$PROGRAMFILES\${COMPANYNAME} ${APPNAME}" | ||
LicenseData "resources\app\LICENSE.md" | ||
Name "${COMPANYNAME} - ${APPNAME}" | ||
Icon "resources\app\build\windows.ico" | ||
outFile "${COMPANYNAME} ${APPNAME} Installer.exe" | ||
|
||
!include LogicLib.nsh | ||
|
||
# Just three pages - license agreement, install location, and installation | ||
page license | ||
page directory | ||
Page instfiles | ||
|
||
!macro VerifyUserIsAdmin | ||
UserInfo::GetAccountType | ||
pop $0 | ||
${If} $0 != "admin" ;Require admin rights on NT4+ | ||
messageBox mb_iconstop "Administrator rights required!" | ||
setErrorLevel 740 ;ERROR_ELEVATION_REQUIRED | ||
quit | ||
${EndIf} | ||
!macroend | ||
|
||
function .onInit | ||
setShellVarContext all | ||
!insertmacro VerifyUserIsAdmin | ||
functionEnd | ||
|
||
section "install" | ||
# Install Program Files | ||
setOutPath $INSTDIR | ||
file /r *.* | ||
|
||
# Install the Atmel bootloader driver | ||
nsExec::Exec '"C:\Windows\System32\PnPutil.exe" -i -a "$INSTDIR\resources\app\dfu\dfu-prog-usb-1.2.2\atmel_usb_dfu.inf"' | ||
|
||
# Uninstaller | ||
writeUninstaller "$INSTDIR\uninstall.exe" | ||
|
||
# Start Menu | ||
createDirectory "$SMPROGRAMS\${COMPANYNAME}" | ||
createShortCut "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}.lnk" "$INSTDIR\QMK Firmware Flasher.exe" "" "$INSTDIR\resources\app\build\windows.ico" | ||
|
||
# Registry information for add/remove programs | ||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "DisplayName" "${COMPANYNAME} - ${APPNAME} - ${DESCRIPTION}" | ||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "UninstallString" "$\"$INSTDIR\uninstall.exe$\"" | ||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S" | ||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "InstallLocation" "$\"$INSTDIR$\"" | ||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "DisplayIcon" "$\"$INSTDIR\windows.ico$\"" | ||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "Publisher" "$\"${COMPANYNAME}$\"" | ||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "HelpLink" "$\"${HELPURL}$\"" | ||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "URLUpdateInfo" "$\"${UPDATEURL}$\"" | ||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "URLInfoAbout" "$\"${ABOUTURL}$\"" | ||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "DisplayVersion" "$\"${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONBUILD}$\"" | ||
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "VersionMajor" ${VERSIONMAJOR} | ||
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "VersionMinor" ${VERSIONMINOR} | ||
# There is no option for modifying or repairing the install | ||
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "NoModify" 1 | ||
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "NoRepair" 1 | ||
# Set the INSTALLSIZE constant (!defined at the top of this script) so Add/Remove Programs can accurately report the size | ||
#WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "EstimatedSize" ${INSTALLSIZE} | ||
sectionEnd | ||
|
||
# Uninstaller | ||
function un.onInit | ||
SetShellVarContext all | ||
|
||
#Verify the uninstaller - last chance to back out | ||
MessageBox MB_OKCANCEL "Permanantly remove ${APPNAME}?" IDOK next | ||
Abort | ||
next: | ||
!insertmacro VerifyUserIsAdmin | ||
functionEnd | ||
|
||
section "uninstall" | ||
# Remove Start Menu launcher | ||
delete "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}.lnk" | ||
rmDir "$SMPROGRAMS\${COMPANYNAME}" | ||
|
||
# Remove files | ||
rmDir /r $INSTDIR | ||
|
||
# Remove uninstaller information from the registry | ||
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" | ||
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