Skip to content

Commit

Permalink
Create NSIS setup script
Browse files Browse the repository at this point in the history
  • Loading branch information
dipu-bd committed Sep 10, 2021
1 parent 6be9c85 commit d570e55
Show file tree
Hide file tree
Showing 6 changed files with 149 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -157,5 +157,6 @@ $RECYCLE.BIN/

#files in old folder
old/

setup/publish/
setup/UVA_Arena_*.exe
!UVA Arena/UVA Arena/pdf.js/build
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Sudipto Chandra

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.
2 changes: 1 addition & 1 deletion UVA Arena/UVA Arena/UVA Arena.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<TargetFrameworkProfile />
<ProductVersion>12.0.0</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<PublishUrl>C:\Users\Dipu\Desktop\UVA Arena\</PublishUrl>
<PublishUrl>C:\Users\Dipu\Projects\UVA-Arena\setup\publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
Expand Down
8 changes: 4 additions & 4 deletions VERSION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version":"1.8.2",
"link":"https://sourceforge.net/projects/uvaarena/files/UVA%20Arena%201.8/UVA_Arena_1.8.2.exe",
"message":"Changed the PDF viewer: using pdf.js.\r\nAuto input-output loader from uDebug.\r\nFull screen code editor side by side of problem description\r\nAuto select code file on selecting folder."
}
"version": "1.9.0",
"link": "https://sourceforge.net/projects/uvaarena/files/UVA_Arena_1.9/UVA_Arena_1.9.0.exe",
"message": "Update uHunt API url\nFixed https network call issue\nUpdate list view library."
}
121 changes: 121 additions & 0 deletions setup/installer.nsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
;NSIS Modern User Interface
;Welcome/Finish Page Example Script
;Written by Joost Verburg

;--------------------------------
;Include Modern UI

!include "MUI2.nsh"

;--------------------------------
;Define variables

!define Company "Sand Soft"
!define AppName "UVA Arena"
!define AppExeName "UVA Arena.exe"
!define SetupIcon "setup.ico"
!define SetupFileName "UVA_Arena_1.9.0.exe"
!define LicenseFile "..\LICENSE"
!define DistFiles "publish\Application Files\UVA Arena_1_9_0_82"

;--------------------------------
;General

Unicode True

;Name and file
Name "${AppName}"
Icon "${SetupIcon}"
OutFile "${SetupFileName}"

;Default installation folder
InstallDir "$PROGRAMFILES64\${AppName}"

;Get installation folder from registry if available
InstallDirRegKey HKCU "Software\${Company}\${AppName}" ""

;Request application privileges for Windows Vista
RequestExecutionLevel admin

;--------------------------------
;Interface Settings

!define MUI_ABORTWARNING
!define MUI_ICON "${SetupIcon}"

;--------------------------------
;Pages

!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "${LicenseFile}"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH

!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH

;--------------------------------
;Languages

!insertmacro MUI_LANGUAGE "English"

;--------------------------------
;Installer Sections

Section "${AppName}" AppFiles

SetOutPath "$INSTDIR"

;Add files to installer
File /r "${DistFiles}\*"

;Store installation folder
WriteRegStr HKCU "Software\${Company}\${AppName}" "" $INSTDIR

;Create uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"

SectionEnd

Section "Start Menu Shortcut" StartMenu
CreateDirectory '$SMPROGRAMS\${Company}\${AppName}'
CreateShortCut '$SMPROGRAMS\${Company}\${AppName}\${AppName}.lnk' '$INSTDIR\${AppExeName}' "" '$INSTDIR\${AppExeName}' 0
CreateShortCut '$SMPROGRAMS\${Company}\${AppName}\Uninstall ${AppName}.lnk' '$INSTDIR\Uninstall.exe' "" '$INSTDIR\Uninstall.exe' 0
SectionEnd

Section "Desktop Shortcut" Desktop
SetShellVarContext current
CreateShortCut "$DESKTOP\${AppName}.lnk" "$INSTDIR\${AppExeName}"
SectionEnd

;--------------------------------
;Descriptions

;Language strings
LangString AppDescription ${LANG_ENGLISH} "Install ${AppName}. This will overwrite files of the previous version."
LangString StartMenuDescription ${LANG_ENGLISH} "Create Start Menu shortcuts."
LangString DesktopDescription ${LANG_ENGLISH} "Create a Desktop shortcut."

;Assign language strings to sections
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${AppFiles} $(AppDescription)
!insertmacro MUI_DESCRIPTION_TEXT ${StartMenu} $(StartMenuDescription)
!insertmacro MUI_DESCRIPTION_TEXT ${Desktop} $(DesktopDescription)
!insertmacro MUI_FUNCTION_DESCRIPTION_END

;--------------------------------
;Uninstaller Section

Section "Uninstall"

Delete "$INSTDIR\Uninstall.exe"

RMDir "$INSTDIR"

DeleteRegKey /ifempty HKCU "Software\${Company}\${AppName}"

SectionEnd
Binary file added setup/setup.ico
Binary file not shown.

0 comments on commit d570e55

Please sign in to comment.