Windows 7 Get all CLI parameters/switches from NSIS installer

Rishab7

New Member
Joined
Apr 17, 2023
Messages
21
Having NSIS installer e.g. Program.exe
Is there a way to get all CLI switches that current installer can process.
The purpose is to automate installation
I don't mean standard switches like /S switch for silent install
I tried to "unzip" Program.exe with 7zip - no useful info found about installer..
I tried to spy on it with Procmon - it's not launching anything on command line - so no luck either
I know for sure that this installer receives custom switches ( one of them is /op=n )
NSIS docs are more about how to create installer..

Thank You!
 
To find out the CLI switches that can be used with an NSIS installer, you can try the following approaches:
  1. Documentation: Check the documentation or any accompanying README file that might have information on supported switches and their usage.
  2. Silent Install Switch: As you mentioned, the /S switch is a common silent install switch used with NSIS installers. Sometimes, additional switches might be supported, such as /VERYSILENT or /SUPPRESSMSGBOXES. You can try running the installer with these switches to see if they are recognized and properly handled. For example:
    Code:
    Program.exe /S Program.exe /VERYSILENT Program.exe /SUPPRESSMSGBOXES
  3. Contact the Developer: If the above methods do not yield any results, it might be best to reach out to the software developer or their support team directly. They should be able to provide you with the correct switches to use for automating the installation process. Keep in mind that not all NSIS installers support customization via command-line switches, and their availability depends on how the installer was specifically designed.
 
If standard methods like documentation, ReadMe files, and contacting the developer haven't provided the necessary information about the command-line switches for the NSIS installer, and reverse engineering isn't feasible or practical, then unfortunately, there might not be a straightforward way to obtain all the available CLI switches. In such cases, trial and error might be your best option. You can try experimenting with different command-line switches to see if they have any effect on the installer's behavior. However, be cautious when using undocumented switches, as they may not be officially supported and could potentially cause unintended issues. Alternatively, if you have access to the source code of the installer script (.nsi file), you can inspect it to identify any custom command-line switches that have been defined within the script. Ultimately, without explicit documentation or access to the installer source code, discovering all possible command-line switches for a custom NSIS installer may be challenging.
 
Hello kemiy,
You're absolutely right—if documentation or direct help from the developer isn’t available, uncovering all CLI switches for an NSIS installer can be challenging. Let me provide some additional suggestions and tips to expand your options:

Exploring NSIS Installer CLI Switches​

  1. Common NSIS Switches:
    You already know about /S for silent install, and there are a handful of other frequently supported switches to experiment with:
    • /D=: Specifies the directory for installation.
      • /NCRC: Skips the CRC check.
      • /LANG=: Specifies a particular language if the installer supports multiple languages.
      • /SUPPRESSMSGBOXES: Suppresses message boxes during installation.

    Example usage:
    Code:
     Program.exe /S /D=C:\MyFolder /SUPPRESSMSGBOXES
    • Command-Line Output:
      Some NSIS installers provide insights on switches when you run the .exe file with /?, /HELP, or similar flags:
      Code:
       Program.exe /? Program.exe /HELP
    • Check for Hidden Switches in the Installer:
      If you have access to the installer file and want to dig deeper:
      • Use a tool like 7-Zip or Resource Hacker to open the installer and inspect the embedded resources. Sometimes, useful hints or documentation are included within the embedded files.
    • Using Process Monitor for Silent Clues:
      Tools like Process Monitor (ProcMon) from Sysinternals can help you monitor the execution of the installer and its sub-processes. By analyzing the installer as it runs, you might discover additional parameters it processes.
    • Inspect Installer Behaviors:
      If the .nsi script source code is not available, here’s an alternative:
      • Use Strings or similar tools to scan the installer binary for clues. For example, running strings on the installer might reveal hidden switches.
    • Decompile NSIS Installer:
      If it's your own installer (or you have permission):
      • Use NSIS’ Uncompile utility to extract the script from the installer if it's not obfuscated. Doing so will give you direct access to all defined switches:
        Code:
         nsis.exe /UNC
    • Look for Community Reports:
      Many NSIS-based setups share common implementation patterns. Searching forums or Stack Overflow for your installer’s name might reveal more undocumented features or switches that others have discovered.


Final Notes​

  • Always Back Up: Before experimenting with any undocumented switches, ensure you have appropriate backups of your system or environment to prevent unintended issues.
  • Trial-and-Error Tip: Use a virtual machine to test your experiments beforehand to reduce the risk of affecting your main system.
If you need further help experimenting or guidance on a specific installer, let me know! Best of luck, and I hope one of these methods reveals all the CLI switches you need!