Since this is the only place I posted this script, and it has almost 200 downloads, I figured it was worth posting an update.
MediaFire is a simple to use free service that lets you put all your photos, documents, music, and video in a single place so you can access them anywhere and share them everywhere.
Over the past few months, I have been stealthily updating the script above without changing the Mediafire link by replacing it directly. The script is now up to v1.2.0 and has had quite a bit of work put into it. I implemented a GUI, and it can now serve as a general purpose file list generator for NSIS as well as generating an uninstall list. This is a good alternative to a (
file /r ) loop as it allows greater control over what happens between adding/removing each file. The latest update improved the speed significantly, as instead of writing all files to the NSH file one by one, it will now write them all once at the end.
The main point of this script is still the ability to add the call to the function (
${PauseIfUserIsMakingAbortDecision} ) after each line, but it's possible to change the inserted command by editing the textbox. This will only make sense if following the tutorial mentioned in the first post, which is a really helpful guide on how to generate an installer that pauses after a user presses the "Cancel" button and waits for input. This script basically relies on the information in that tutorial, unless you are just using it to generate file lists.
Here is a description of each option:
Program Install Path: This is the root path of the files you wish to include in your installer.
Installer List Path: This is the path to output
FileList.nsh which is the generated file list with the pause command after every line.
Insert custom command: The custom command added after every file in the list, which defaults to the function name from the tutorial.
Generate uninstaller: Also generates an
UninList.nsh which is a file list to be used in an uninstaller. The textbox below is the intended uninstaller name (
$UninFileName ).
Include commands: This adds a command to the installer list to create the uninstaller (
WriteUninstaller "$INSTDIR/$UninFileName" ) and adds a command to the uninstaller list to delete the uninstaller after uninstalling (
Delete "$INSTDIR\$UninFileName" ). Uncheck this if you wish to handle these commands in the host script (.nsi) rather than these (.nsh) scripts.
Do not display message box: This hides the GUI message box that displays progress and prevents text being written to it. This should be checked when dealing with very large installers, as printing text to the GUI is slow and will overall increase the amount of time to generate the lists. For hundreds of files, it's not really needed. For thousands+, I suggest checking it.
Here is some instructions on how to use this:
- If you wish to pause the installer when cancelling, follow the tutorial here:
https://nsis.sourceforge.io/InstFile...ring_InstFiles
- Right click the script and click
Run with PowerShell
- Set the
Program Install Path to the root location of the files you wish to install
- Set any options you may want to modify
- Press
Start and it will generate the lists of files with the optionally included command
- Include the NSH files in your script. In the installer section, use (
!include FileList.nsh ) and in the uninstaller section, use (
!include UninList.nsh ). They should be in the same path as your NSI script. If not, the path will need to be added to the include command.
I think that is everything I can think of. If I think of anything new to add to it, find any bugs, or think of ways to optimize it further, I will continue to just update the link so it never changes. This forum does not allow editing posts, so I'll try to keep the link static. If for some reason it ends up changing, I'll post a followup with a new link. And if you read this far, I hope it's been useful for you!