Giter Club home page Giter Club logo

node-innosetup-compiler's Introduction

node-innosetup-compiler

Node module to compile inno setup scripts (.iss)

This is a simple node wrapper of Inno Setup compiler: ISCC.exe

OS Support

Windows

Works natively on windows

Linux & Mac OS X

Works if wine is installed

Note for Mac OS X Users: If you get the following error err:macdrv:process_attach Failed to start Cocoa app main loop, you may need to update wine to a more recent version (devel)

brew install wine --devel

Usage

All options are optional

Command line
npm install -g innosetup-compiler
innosetup-compiler myscript.iss --gui --verbose --signtoolname=signtool --signtoolcommand='"path/to/signtool.exe" sign /f "C:\\absolute\\path\\to\\mycertificate.pfx" /t http://timestamp.globalsign.com/scripts/timstamp.dll /p "MY_PASSWORD" $f'
Node JS
npm install innosetup-compiler
require("innosetup-compiler")("path/to/your/innoscript.iss", {
    gui: false,
    verbose: false,
    signtoolname: 'signtool',
    signtoolcommand: '"path/to/signtool.exe" sign /f "C:\\absolute\\path\\to\\mycertificate.pfx" /t http://timestamp.globalsign.com/scripts/timstamp.dll /p "MY_PASSWORD" $f'
}, function(error) {
    // callback
});

Or using promise

require("innosetup-compiler")("path/to/your/innoscript.iss", {
    gui: false,
    verbose: false,
    signtoolname: 'signtool',
    signtoolcommand: '"path/to/signtool.exe" sign /f "C:\\absolute\\path\\to\\mycertificate.pfx" /t http://timestamp.globalsign.com/scripts/timstamp.dll /p "MY_PASSWORD" $f'
}).then(callback).catch(callback);

Or async

try {
	await require("innosetup-compiler")("path/to/your/innoscript.iss", {
	    gui: false,
	    verbose: false,
	    signtoolname: 'signtool',
	    signtoolcommand: '"path/to/signtool.exe" sign /f "C:\\absolute\\path\\to\\mycertificate.pfx" /t http://timestamp.globalsign.com/scripts/timstamp.dll /p "MY_PASSWORD" $f'
	});
} catch(error) {
	console.log(error);
}
Grunt
npm install innosetup-compiler --save-dev
grunt.loadNpmTasks('innosetup-compiler');
...
grunt.initConfig({
    ...
    "innosetup_compiler": {
        your_target: {
          options: {
            gui: false,
            verbose: false,
            signtoolname: 'signtool',
            signtoolcommand: '"path/to/signtool.exe" sign /f "C:\\absolute\\path\\to\\mycertificate.pfx" /t http://timestamp.globalsign.com/scripts/timstamp.dll /p "MY_PASSWORD" $f'
          },
          script: "path/to/your/innosetup/script.iss"
        }
    }
    ...
});

Options

options.verbose

Default: false

Print full log output

options.gui

Default: false

Use Compil32.exe instead or ISCC.exe (GUI mode)

all other options are ignored in this case

options.signtoolname and options.signtoolcommand

Default: null

The name and command used to sign installer and uninstaller See Innosetup Signtool documentation

Other ISCC Options

Default: none

All ISCC.exe options can be used (without the trailing slash).

  • Command line using the --[Arg]=[Val1];[Val2] syntax
innosetup-compiler myscript.iss --O=outputfile.exe
  • Node JS
require("innosetup-compiler")("path/to/your/innoscript.iss", {
    O: 'outputfile.exe'
}, function(error) {
    // callback
});
  • Grunt
grunt.loadNpmTasks('innosetup-compiler');
...
grunt.initConfig({
    ...
    "innosetup_compiler": {
        your_target: {
          options: {
            O: 'outputfile.exe'
          },
          script: "path/to/your/innosetup/script.iss"
        }
    }
    ...
});

More info in official innosetup documentation: Command Line Compiler Execution

Credits

Thanks to Jordan Russell and Martijn Laan for their amazing work on Inno Setup

node-innosetup-compiler's People

Contributors

denistorresan avatar erase2004 avatar etiktin avatar felicienfrancois avatar herculanogripp avatar joaomoreno avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-innosetup-compiler's Issues

Upgrade to 6.2.0

Hi felicienfrancois,

vscode is currently using your node-innosetup-compiler as a dependency for innosetup.
There is an increasing number of developers who would like use to functions from innosetup 6.2.0.
Would you like to upgrade the version from 5.6.1 to 6.2.0?

Thanks,
vscode dev team

Setup installer detected as virus (false positive)

The setup installer created with Inno Setup Compiler was being detected as a virus by Windows Defender on the latest version of Windows 10 Professional. The issue actually started showing after the file was named as "setup.exe" in particular. Customized naming before the same had no issues. After using the "setup" name for the desired exe installer by chance, even customized naming then onwards were giving issues.

Currently I have updated versions of the installer and for now Windows Defender is ok with them apparently. But I thought I should report it here.

Here are the details of the report that were generated:

Alert level: Severe
Status: Quarantined
Date: 22-04-2018

Recommended action: Remove the threat now.

Category: Trojan
Details: This program is dangerous and executes commands from an attacker.

Learn More

O (output) parameter only indicates directory

What OS AM I using?
Windows 10 64bit

What happened?
When using both Node.js and CLI API - the O parameter in the options field - creates a directory of that value instead of a file.
For example if I inserted {O: 'setup.exe'} I eventually found a directory called setup.exe and inside it the installer carrying the name of the executable inside the folder I gave in the first parameter.

What was expected to happen?
The O parameter should have created a file called setup.exe rather than a directory.

Error while compile

Hi,
I catch error
Error on line 28 in D:\...\..\file.iss: Resource update error: EndUpdateResource failed (110)
After 3-4 attempts returns, success.
Here my iss file (i compile him with native inno-setup gui):


; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Some_Name"
#define MyAppVersion "1.0.0"
#define MyAppPublisher "SomeCompany"
#define MyAppURL "https://some.site/"
#define MyAppExeName "Some_Name.exe"
#define MyAppSystem "win32-ia32"
#define MyAppDirName "dist\MyAppName"

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{7D55623D-400C-4E2D-AAF4-41218D604617}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DisableProgramGroupPage=yes
OutputDir=.\dist
OutputBaseFilename=Some_Name_{#MyAppVersion}_{#MyAppSystem}
SetupIconFile=icon.ico
Compression=lzma
SolidCompression=yes

[Languages]
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}";

[Files]
Source: "{#MyAppDirName}-{#MyAppSystem}\MyAppName.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#MyAppDirName}-{#MyAppSystem}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{commonprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

Support for M1 Macs

Howdy 🤠 ,

I'm trying to run a script to build an installer that I haven't run in a handful of years, and have never run on my M1 mac. I'm getting errors that I suspect are related either to being on an M1 or 64bit. I'm curious if you can confirm if M1s are supported so I could rule that out as the source of the issue.

yarn innosetup-compiler ./config/windows-installer.iss
(node:4539) UnhandledPromiseRejectionWarning: Error: spawn Unknown system error -86
    at ChildProcess.spawn (internal/child_process.js:405:11)
    at spawn (child_process.js:677:9)
    at spawnWithSignal (child_process.js:911:17)
    at /…/node_modules/innosetup-compiler/lib/iscc.js:48:21
    at new Promise (<anonymous>)
    at Function.module.exports (/…/node_modules/innosetup-compiler/lib/iscc.js:7:19)
    at Object.<anonymous> (/…/node_modules/innosetup-compiler/lib/iscc:15:5)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:4539) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:4539) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I was digging through your code and came across https://github.com/felicienfrancois/node-innosetup-compiler/blob/master/lib/iscc.js#L45 where the command wine is used instead of wine64. As an experiment, I tried changing it to wine64 which still had an error, but looked like one that indicated some progress:

yarn innosetup-compiler ./config/windows-installer.iss
preloader: Warning: failed to reserve range 0000000000010000-0000000000110000
preloader: Warning: failed to reserve range 0000000000010000-0000000000110000
preloader: Warning: failed to reserve range 0000000000010000-0000000000110000
preloader: Warning: failed to reserve range 0000000000010000-0000000000110000
preloader: Warning: failed to reserve range 0000000000010000-0000000000110000
preloader: Warning: failed to reserve range 0000000000010000-0000000000110000
preloader: Warning: failed to reserve range 0000000000010000-0000000000110000
preloader: Warning: failed to reserve range 0000000000010000-0000000000110000
Application could not be started, or no application associated with the specified file.
ShellExecuteEx failed: Internal error.

(node:4726) UnhandledPromiseRejectionWarning: preloader: Warning: failed to reserve range 0000000000010000-0000000000110000
preloader: Warning: failed to reserve range 0000000000010000-0000000000110000
preloader: Warning: failed to reserve range 0000000000010000-0000000000110000
preloader: Warning: failed to reserve range 0000000000010000-0000000000110000
preloader: Warning: failed to reserve range 0000000000010000-0000000000110000
preloader: Warning: failed to reserve range 0000000000010000-0000000000110000
preloader: Warning: failed to reserve range 0000000000010000-0000000000110000
preloader: Warning: failed to reserve range 0000000000010000-0000000000110000

(Use `node --trace-warnings ...` to show where the warning was created)
(node:4726) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:4726) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Can you please give me a sanity check and let me know if it should be working?

Progress or Error feedback?

Is there supposed to be any feedback for progress or errors? The script seems to do absolutely nothing at all and it's unclear just what, if anything, is happening.

signtool

Tell me please, how can I find signtool.exe and how can I create pfx file on macOS?
Is it possible to sign app with macOS?

Batch Script is stopped after first call of innosetup-compiler

I have a Batch-script where I want to compile two .iss scripts with innosetup-compiler, but after the first one is executed, no matter if it succeeds or fails, the script just stopps, no matter what comes after that. When I change to ISCC.exe (not installed through npm) everything works fine.

Languages\BrazilianPortuguese

Hi.

I'm a Brazilian guy and I have doubt about the node-innosetup-compiler.

In my Iss code, I used.

Name: "brazilianportuguese"; MessagesFile: "compiler:Languages\BrazilianPortuguese.isl"

But the shell showed the following error.

Running "innosetup-compiler:my_update" (innosetup-compiler) task

[ISPP] Preprocessing.Error on line 30 in D:\www\web_comboio\branches\app\script\update.iss: Couldn't open include file "
D:\www\web_comboio\branches\node_modules\innosetup-compiler\bin\Languages\BrazilianPortuguese.isl": O sistema n?o pode e
ncontrar o caminho especificado.
Compile aborted.
Warning: Task "innosetup-compiler:my_update" failed. Use --force to continue.

Aborted due to warnings.

When I use the specific path of my machine for the Brazilian language, it works correctly.

Name: "brazilianportuguese"; MessagesFile: "C:\Program Files (x86)\Inno Setup 5\Languages\BrazilianPortuguese.isl"

But I wouldn't want to use that specific path. Because, if I change the machine this path can change.

Can you help-me?

run with wine, when the path of iss file start with /, output error "unknow option"

when i run under linux with wine.
cmdLine: wine
args: [ '/home/test/xxx/node_modules/innosetup-compiler/bin/ISCC.exe',
'/home/test/xxx/inno-setup/setup_install.iss' ],
output error: Unknown option: /home/test/xxx/inno-setup/setup_install.iss

because /home/ is recognise as an option。

solution:

i change the path to \home\test\xxx\inno-setup\setup_install.iss, and run success.
so the path must not start with /, or add the code:

if (!/^win/.test(process.platform)) {                                                                                                                                                                                               
  scriptPath = scriptPath.replace(/\//g, '\\');
}  

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.