Inno setup cannot find needed node msi file during installation (windows)

49 Views Asked by At

Took over this innosetup script from a guy which just quit. Very close to making it work. It creates the install file but it fails finding the node.msi and nssm.exe files during installation.

Part of Script :

[Files]
Source: "../server/*"; DestDir: "{app}\server"; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: "node_modules\.bin" 
Source: "../client/build/*"; DestDir: "C:\inetpub\wwwroot"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "web.config"; DestDir: "C:\inetpub\wwwroot"; Flags: ignoreversion
Source: "node-v20.10.0-x64.msi"; DestDir: "{app}"; Flags: ignoreversion external
Source: "nssm.exe"; DestDir: "{app}"; Flags: ignoreversion external
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Run]
Filename: "{sys}\msiexec.exe"; Parameters: "/passive /i ""{app}\{#NODE}""";

Filename: "{sys}\netsh.exe"; Parameters: "advfirewall firewall add rule name=""Node In"" program=""{commonpf64}\nodejs\node.exe"" dir=in action=allow enable=yes"; Flags: runhidden;
Filename: "{sys}\netsh.exe"; Parameters: "advfirewall firewall add rule name=""Node Out"" program=""{commonpf64}\nodejs\node.exe"" dir=out action=allow enable=yes"; Flags: runhidden;

Filename: "{app}\{#NSSM}"; Parameters: "install {#MyAppShortName} ""{commonpf64}\nodejs\node.exe"" "; Flags: runhidden;
Filename: "{app}\{#NSSM}"; Parameters: "set {#MyAppShortName} AppDirectory ""{app}\server"" "; Flags: runhidden;
Filename: "{app}\{#NSSM}"; Parameters: "set {#MyAppShortName} AppParameters ""index.js"" "; Flags: runhidden;
Filename: "{app}\{#NSSM}"; Parameters: "set {#MyAppShortName} AppStdout ""{app}\logs\stdout.log"" "; Flags: runhidden;
Filename: "{app}\{#NSSM}"; Parameters: "set {#MyAppShortName} AppStderr ""{app}\logs\stderr.log"" "; Flags: runhidden;
Filename: "{sys}\net.exe"; Parameters: "start {#MyAppShortName}"; Flags: runhidden;

It's compiling correctly :

enter image description here

Tried to put the needed files in different folders without success :

enter image description here

Fails miserably during install :

enter image description here

1

There are 1 best solutions below

0
Bill_Stewart On BEST ANSWER

Per the documentation regarding the [Files] section:

When the flag external is specified, Source must be the full pathname of an existing file (or wildcard) on the distribution media or the user's system (e.g. "{src}\license.ini").