Last active
February 7, 2019 15:52
-
-
Save Overwatch-C-17/c0269134b242e8ba1e47c23a5abecc94 to your computer and use it in GitHub Desktop.
A custom Self Extracting Archive made using NSIS
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
!echo "SELF EXTRACTING ARCHIVE SCRIPT - English Only" ; Going to set this script into generic self extractor instead of installer | |
; Main Installer settings | |
Name "Generic Files" | |
BrandingText "File Extractor v0.1 - English Only" | |
Caption "File Extractor: Generic Files" | |
CompletedText "Extraction Success!" | |
CRCCheck force | |
InstallButtonText "Extract" | |
InstallDir "$EXEDIR" | |
MiscButtonText "Back" "Next" "Quit" "Close" | |
OutFile ".\files_sfx.exe" | |
RequestExecutionLevel user | |
SetFont "Arial" 8 | |
ShowInstDetails show | |
; Use compression | |
SetCompressor /SOLID lzma | |
SetCompressorDictSize 16 | |
; Modern interface settings (Modern User Interface 2 Recommended) | |
!include "MUI2.nsh" | |
; Define custom installer UI settings | |
!define MUI_ABORTWARNING | |
!define MUI_ABORTWARNING_TEXT "Do you want to quit File Extractor?" | |
!define MUI_COMPONENTSPAGE_CHECKBITMAP "${NSISDIR}\Contrib\Graphics\Checks\simple-round2.bmp" | |
!define MUI_COMPONENTSPAGE_SMALLDESC | |
!define MUI_COMPONENTSPAGE_TEXT_TOP "See the list below, check files you wish to extract or uncheck if you don't. If there are one or more child lists, you can expand the parent tree to see more options." | |
!define MUI_COMPONENTSPAGE_TEXT_COMPLIST "Select files below to be extracted:" | |
!define MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_INFO "Hover mouse over file list to see explanation" | |
!define MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_TITLE "Explanation" | |
!define MUI_DIRECTORYPAGE_TEXT_TOP "Click $\"Browse$\" to locate a directory where you want your files to be extracted by File Extractor." | |
!define MUI_DIRECTORYPAGE_TEXT_DESTINATION "Extract Location" | |
!define MUI_ICON "..\..\RESOURCES\Icon_29.ico" | |
!define MUI_INSTFILESPAGE_COLORS "FF0000 000000" | |
!define MUI_INSTFILESPAGE_FINISHHEADER_TEXT "Extraction Completed" | |
!define MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT "File extraction have been completed successfully" | |
!define MUI_INSTFILESPAGE_ABORTHEADER_TEXT "Extraction Cancelled" | |
!define MUI_INSTFILESPAGE_ABORTHEADER_SUBTEXT "File extraction aborted by user" | |
!define MUI_TEXT_COMPONENTS_TITLE "Select Files" | |
!define MUI_TEXT_COMPONENTS_SUBTITLE "Which files you want to extract" | |
!define MUI_TEXT_DIRECTORY_TITLE "Destination Folder" | |
!define MUI_TEXT_DIRECTORY_SUBTITLE "Where your files should be extracted" | |
; Installer pages | |
!insertmacro MUI_PAGE_COMPONENTS | |
!insertmacro MUI_PAGE_DIRECTORY | |
!insertmacro MUI_PAGE_INSTFILES | |
; Set languages (first is default language) | |
!insertmacro MUI_LANGUAGE "English" | |
!insertmacro MUI_RESERVEFILE_LANGDLL | |
; Installation Type | |
; (NO SCRIPT COMMAND ATM) | |
; Files section | |
SectionGroup /e "!Files" SG1 | |
Section /o "No File Specified" SG1S1 | |
SetOverwrite ifdiff | |
SetOutPath "-" | |
;Uncomment Line below and insert your file here! | |
;File "" | |
DetailPrint "Done!" | |
SectionEnd | |
SectionGroupEnd | |
; Defined function (Delete/Comment this if you don't want your file requiring specified file) | |
Function .onInit | |
IfFileExists "$INSTDIR\myfile.txt" ContinueExtractor FileDoesNotExist | |
FileDoesNotExist: | |
MessageBox MB_YESNO|MB_USERICON "It seems required file isn't here. Do you still want to continue with the extraction?" IDYES ContinueInstaller IDNO ExitExtractor | |
ExitExtractor: | |
Quit | |
ContinueExtractor: | |
Nop | |
FunctionEnd | |
; Modern install component descriptions | |
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN | |
!insertmacro MUI_DESCRIPTION_TEXT ${SG1} "List of packaged files (Expanded Automatically)." | |
!insertmacro MUI_DESCRIPTION_TEXT ${SG1S1} "Currently no file inside this package." | |
!insertmacro MUI_FUNCTION_DESCRIPTION_END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment