Skip to content
This repository has been archived by the owner on Jun 19, 2021. It is now read-only.

Commit

Permalink
Changes for the 0.5.1 installer
Browse files Browse the repository at this point in the history
  • Loading branch information
skullydazed committed May 28, 2017
1 parent 4f06210 commit 6c432d4
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 29 deletions.
2 changes: 1 addition & 1 deletion dist-win32.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ electron-packager ./ --platform=$plat --arch=$arch \
--out "$output_dir" \
--overwrite=true \
--prune
cp qmk_firmware_flasher.win32.nsi "${output_dir}/${package_dir}"
cp build/windows.ico qmk_firmware_flasher.win32.nsi "${output_dir}/${package_dir}"

# Zip up the package
(
Expand Down
54 changes: 27 additions & 27 deletions qmk_firmware_flasher.win32.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@
# 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 APPNAME "QMK 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
!define VERSIONBUILD 1
# 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/qmk-firmware-flasher/issues" # "Support Information" link
!define UPDATEURL "https://github.com/jackhumbert/qmk-firmware-flasher/releases" # "Product Updates" link
!define ABOUTURL "https://github.com/jackhumbert/qmk-firmware-flasher" # "Publisher" link
!define HELPURL "https://github.com/qmk/qmk_firmware_flasher/issues" # "Support Information" link
!define UPDATEURL "https://github.com/qmk/qmk_firmware_flasher/releases" # "Product Updates" link
!define ABOUTURL "https://github.com/qmk/qmk_firmware_flasher" # "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"
InstallDir "$PROGRAMFILES\${APPNAME}"
LicenseData "LICENSE.md"
Name "${APPNAME}"
Icon "windows.ico"
outFile "${APPNAME} ${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONBUILD} Installer.exe"

!include LogicLib.nsh

Expand Down Expand Up @@ -62,26 +62,26 @@ section "install"

# Start Menu
createDirectory "$SMPROGRAMS\${COMPANYNAME}"
createShortCut "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}.lnk" "$INSTDIR\QMK Firmware Flasher.exe" "" "$INSTDIR\resources\app\build\windows.ico"
createShortCut "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}.lnk" "$INSTDIR\QMK Firmware Flasher.exe" "" "$INSTDIR\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}
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayName" "${APPNAME} - ${DESCRIPTION}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "InstallLocation" "$\"$INSTDIR$\""
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayIcon" "$\"$INSTDIR\windows.ico$\""
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "Publisher" "$\"${COMPANYNAME}$\""
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "HelpLink" "$\"${HELPURL}$\""
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "URLUpdateInfo" "$\"${UPDATEURL}$\""
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "URLInfoAbout" "$\"${ABOUTURL}$\""
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayVersion" "$\"${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONBUILD}$\""
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "VersionMajor" ${VERSIONMAJOR}
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${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
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${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}
#WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "EstimatedSize" ${INSTALLSIZE}
sectionEnd

# Uninstaller
Expand All @@ -104,5 +104,5 @@ section "uninstall"
rmDir /r $INSTDIR

# Remove uninstaller information from the registry
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}"
sectionEnd
14 changes: 13 additions & 1 deletion src/MainWindow/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,25 @@ $(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip()
})

//open links externally by default
var shell = require('electron').shell;
$(document).on('click', 'a[href^="http"]', function(event) {
event.preventDefault();
shell.openExternal(this.href);
});

// Ready to go
exec(dfu_location + ' --version', function(error, stdout, stderr) {
if (stderr.indexOf('dfu-programmer') > -1) {
window.setTimeout(checkForBoard, 10);
sendStatus("Select a firmware file by clicking 'Choose .hex' or drag and drop a file onto this window.");
} else {
sendStatus("Could not run dfu-programmer! Please report this as a bug!");
if (process.platform === 'win32') {
sendStatus("Could not run dfu-programmer! Have you installed the driver?");
sendStatus("<br>Try using <a href=\"https://github.com/qmk/qmk_driver_installer/releases\">qmk_driver_installer</a> to fix it.");
} else {
sendStatus("Could not run dfu-programmer! Please report this as a bug!");
}
sendStatus("<br>Debugging information:<br>");
sendStatus(error);
sendStatus("stdout:");
Expand Down

0 comments on commit 6c432d4

Please sign in to comment.