Let’s Create a Silent Windows Installer for a PPI Network

If you need to make an installer for your software, I recommend the open source NSIS install creator. It’s completely FOSS software that you can use for commercial applications. You will need this if you are trying to create a silent installer for a Pay Per Install network, or for a download page.
An installer is one of the best alternatives to distributing your software as a ZIP archive.

First, start by adding all of the files and files of your application to this default directory folder (“MySoftware”). For your first installer, we shall create a new folder for the main package.

Simply click to edit the file.

A title in the “Save As” dialog, browse to assembling your project directory (“NSIS\MyFirst”) and provide the file. For this workout, we will name the file MyFirst.nsi.

Next, we will install the NSIS Editor. You’ll download the variation that is latest of HM NSIS Editor. Download and run.x that is nisedit2.x, accepting all of the defaults. As soon as the installer claims that it has completed, make certain “Run HM NIS Edit” is checked and then click Finish.

Here’s a spot that is great name a number of the useful constants that NSIS defines for people. Additionally, they added these to their part that is a variable of help. Remember the InstallDir feature? It’s the feature that sets the installation directory for people unless you. You need your installer files to become copied (like C:\MainFolder), you will have to know some paths just like the Windows folder course or the Program Files folder path unless you are sure about where precisely. Constants allow you to right here. At runtime, they will probably be changed with end-user computer paths. Please consider the instance that is after

Click on the Browse button.
It supports LZMA compression, which will be the compression method that is most beneficial available. LZMA has a compression that is high (about double the compression ratio of zipping) and fast decompression speed.
Hit Ctrl-F and search for several cases of the expressed word MessageBox.
Select the group that is optional click the “Add file” button.
Bear in mind that when you add any action that is permanent the installer, you have to add the alternative action to your uninstaller.
First, we shall install NSIS. You’ll install the version of the latest NSIS. Download and run the installer, accepting all the defaults. Whenever installer claims that it has completed, uncheck both “Run NSIS” and “Show launch notes” and then click Finish.

Click on the “New group” switch.

For the source file, choose MyNewShortcut.txt.
For the destination directory, specify “$INSTDIR\AnotherFolder”
Installing NSIS
IfSilent +2
Edit permit.txt to contain your permit contract for the applying.
Start Windows Explorer and go directly to the “My Documents” folder.
All installers and uninstallers built by NSIS have a mode that is silent/S) for silent, automatic installs and uninstalls.
Highlight MyNewShortcut.txt and remove it through the list.
In your project that is a new folder”MyFirst”), create a text file known as license.txt.
Regarding the “Execute after setup” display screen, you have the choice to let the customer launch a scheduled program, and/or launch a readme file after the install is complete. With this exercise, we shall blank keep this area. Click Next. Click Next once more.
This short article will guide you through the entire process of setting up NSIS and making your NSIS that is first installed that displays a license contract, permits the user to pick which components to put in, prompts for the location directory, applies file changes, and adds a Start Menu group with shortcuts.

For instance, you have to add “Delete “$SMPROGRAMS\My Installer\MyNewShortcut.lnk” to your uninstaller if you add “CreateShortCut “$SMPROGRAMS\My Installer\MyNewShortcut.lnk” “$INSTDIR\AnotherFolder\MyNewShortcut.txt” to the MainSection of your installer.
Making your NSIS install that is the very first package
Click OK.
“IfSilent +2” instructs NSIS to move two lines forward from the line that currently skips the following line) if we are running in quiet mode.
Regarding the “Application Icons” display screen, specify the Start Menu folder name “my Application that is first”. The Wizard will define some shortcuts automatically for you pointing towards the .exe and .chm (assistance) files of your application. Choose the “$Desktop” shortcut and click “Remove shortcut”. Click the New Shortcut. For “Shortcut:” specify “$ICONS_GROUP\MyShortcut.lnk”. For “Destination:” choose “$INSTDIR\AFolder\MyShortcut.txt”.

The action that is 2nd making an install package is to utilize HM NIS Edit’s “NSIS Script Wizard” to create an NSIS Script in line with the folder structure we created earlier.

On the “Wizard finished” display screen, make sure “conserve script” and “Convert file paths to paths that are generally are checked.

It features a tiny (34 KB) overhead size.
The command is run by you”C:\Program Files\MySoftware\uninstall.exe” and proceed with the prompts to get rid of the application.
To create a simple installer with NSIS, we must begin learning the NSIS language that is scripting. The idea is we create a single (or multiple) files (s) that s which can be contained ( the script instructions. Then we ask the NSIS compiler to compile the file and produce a setup file that is executable.
Then we ask the NSIS compiler to compile the file and produce a setup file that is executable.

Regarding the “Application directory and permit” screen, specify the true name of the standard directory folder we created earlier (“MySoftware”) into the format $PROGRAMFILES\MySoftware. Choose whether or otherwise not the user is desired by you to definitely be able to change the application directory. Then browse to the permit file (“license.txt”) you created earlier.

The action that is first making an install package is to develop a directory for any project gather every one of the files you will need to install as a framework like the areas you need them installed to by your installer.

  1. Create a folder under your new task folder (“MyFirst”) with all the name that is exact same need whilst the title for the installer’s standard directory. We will phone this folder “MySoftware”.
  2. It is possible to run the command ” C:\Program Files\MySoftware\uninstall.exe” /S” to silently take away the application.
  3. Simply click okay Again.
  4. Select your MySoftware simply click and folder OK.
  5. To include an action to you uninstaller, modify the relative lines between “Section Uninstall” and “SectionEnd”.
    Name the combined group”Optional” and then click okay.
  6. Enter the Description “Installs the application that is primary
  7. Create a folder that is a brand new “NSIS”. This will be where you retain all of your NSIS projects.
  8. After the install completes, it’s going to compose an uninstaller in the directory it was installed to named.exe that is uninstalled. It adds a mention of that uninstaller in your “Add or Removes Programs” Control Panel Applet. You’ll uninstall this application in one of three ways.

Enter the Description “Installs components that are optional
You now have .nsi file which will produce an installer that will show a license contract, prompt for the destination directory, include the files and folders you specified and adds a Start Menu group with shortcuts. You can now include any action to your script using the text editor if you like your installer to complete something more.

It is completely free for any usage.
I usually make sure that the installer and uninstaller can be run quietly before We start thinking about any install script complete. NSIS automatically supports the ‘/S’ switch (realize that it really is S that is capital perform silent installs and uninstalls. Nonetheless, this switch shall perhaps not suppress Message containers by the standard. We will need certainly to find any Message Box and include the logic which will miss the message box if the uninstaller or installer is being run in silent mode.

For each MessageBox demand you discover, add the after as being a line that is brand new before it:
To include an action to your MainSection of your installer, modify the general lines between “Section “MainSection” and “SectionEnd”.
Create a folder underneath the brand new “NSIS” folder for your project. We shall phone this folder “MyFirst”.
NSIS (Nullsoft Scriptable Install System) is definitely a supply that is available to create Windows installers. Its designed to be as versatile and tiny that you can and is consequently very ideal for internet distribution.

Enter a description for both MainSection and Optional.
On the “Application Files” screen, we will produce two groups “MainSection” and “Optional”. MainSection shall contain everything with the exception of MyNewShortcut.txt, and Optional will include MyNewShortcut.txt.
Click Next.
If the Files pane is empty, go through the “Add directory tree” button.
It is possible to start the “Add or Remove Programs” Control Panel Applet, discover the application in the list, choose to remove it and follow the prompts to remove the application.
Listed here is a few of why is NSIS handy:

To add an action to the Optional Section of one’s installer, modify the general lines between “Section “Optional” and “SectionEnd”.
Enable “Allow individual to pick the components to set up”

NSIS itself shall just read .nsi (Install System Script) files and proceed with the guidelines into the .nsi file to build a.exe that is a self-installing file. You shall likewise require an NSI Editor/IDE so that you can produce the .nsi declare NSIS. My NSI that is favorite Editor HM NIS Edit.

Create the Installer
Once the compilation has finished, you are able to run InstallMyFirst.exe to operate the installer you simply created. To introduce the installer quietly, run the command “InstallMyFirst.exe /S”.

Remove some of the test files which can be listed by showcasing them and pressing the ‘X’ switch.
Making use of NSIS, you will probably be able to repackage your installers that have multiple files into a solitary, highly compressed executable. Your installers will complete faster and consume less bandwidth. Additionally manage to script administrative changes to your devices, such as for example deploying a typical desktop, or updating a particular registry value, or deploying a credit card application that is in-house.

While NSIS is infinitely extensible and can do anything from producing services to checking for and prerequisites which are setting up configuring the Windows firewall, additionally it is acutely very easy to begin to use for simple file and registry modifications.

Now click on the Save switch to save your self most of the noticeable changes you earn. Click “NSIS>Compile script” to create your installer executable.

Final Words
There are still many possibilities and tips to mention here, but if I do, I will put the NSIS help in a different order here.
I think that’s enough to start with the installers, and just like my own installation, you’ll find what you need quickly. Good luck!

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *