Skip to content

Commit

Permalink
[v1.0.1] Update information - Remove quote marks
Browse files Browse the repository at this point in the history
- Add file version information
- Remove context menu items before removing uninstall information
- Change update URL to latest release
  • Loading branch information
RedSparr0w committed Jul 14, 2019
1 parent 33dc21a commit 2abd234
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 11 deletions.
35 changes: 25 additions & 10 deletions installer.nsi
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
!define PUBLISHER "RedSparr0w"
!define APPNAME "Map2Drive"
!define DESCRIPTION "Map Drives Quickly"
!define DESCRIPTION "Map Folders to Drives Quickly"
# These three must be integers
!define VERSIONMAJOR 1
!define VERSIONMINOR 0
!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/RedSparr0w/Map2Drive"
!define UPDATEURL "https://github.com/RedSparr0w/Map2Drive/releases"
!define UPDATEURL "https://github.com/RedSparr0w/Map2Drive/releases/latest"
!define ABOUTURL "https://github.com/RedSparr0w/Map2Drive"
# This is the size (in kB) of all the files copied into "Program Files"
!define INSTALLSIZE 69
Expand All @@ -24,6 +24,20 @@ Name "${APPNAME}"
Icon "logo.ico"
outFile "${APPNAME}.exe"

LoadLanguageFile "${NSISDIR}\Contrib\Language files\English.nlf"
;--------------------------------
;Version Information

VIProductVersion "${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONBUILD}.0"
VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "${APPNAME}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductVersion" "${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONBUILD}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "Comments" "${DESCRIPTION}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "${PUBLISHER}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "${DESCRIPTION}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONBUILD}.0"

;--------------------------------

!include LogicLib.nsh

# Just three pages - license agreement, install location, and installation
Expand Down Expand Up @@ -88,11 +102,11 @@ section "install"
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\logo.ico$\""
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "Publisher" "$\"${PUBLISHER}$\""
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}$\""
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "Publisher" "${PUBLISHER}"
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
Expand Down Expand Up @@ -127,8 +141,9 @@ section "uninstall"
# Try to remove the install directory - this will only happen if it is empty
rmDir $INSTDIR

# Remove context menu items from the registry
DeleteRegKey HKCR "Folder\shell\${APPNAME}"
DeleteRegKey HKCR "Drive\shell\${APPNAME}"
# Remove uninstaller information from the registry
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}"
DeleteRegKey HKCR "Folder\shell\${APPNAME}"
DeleteRegKey HKCR "Drive\shell\${APPNAME}"
sectionEnd
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Adds an option on the context menu when you right click a folder to map that fol
### Options
#### Folders:
- Quick Map Drive:
- Temporarily mount your folder to the next available drive letter `Z-A`
- Temporarily mount your folder to the next available drive letter `ZA`
- Map Drive:
- Gives you the option to specify a drive letter, name and whether the drive should persist across reboots

Expand Down

0 comments on commit 2abd234

Please sign in to comment.