NSIS nsExec path issue perhaps - node.js

First time with making an installation file. Using NSIS. Trying to run a nodeJS script command line after installation completes and poking about online suggestions all seem to be a variation of
Section "runNodeJavascript"
nsExec::Exec '"$SYSDIR\cmd.exe" /c
node "c:\Program Files (x86)\FolderOne\FolderTwo\JavascriptToRun.js"'
SectionEnd
But my experimentation so far is for naught, any insight? Everything else with NSIS online has been pretty helpful making a little installer but for some reason hitting a little barrier here...

Related

NSIS zipDLL.nsh not working with NSIS portable version

I'm trying to compile a script, perfectly working with NSIS installing version, by NSIS partable version but it doesn't work.
Other .nsh files, also natively available in Include folder of NSIS portable version, called by the script are working well. The web downloaded zipdll.nsh file, added in a second time into the Include folder of NSIS portable version, is at moment the only file called by the script that doesn't work!
The compiler gets back the following message:
!include: "C:\PortableApps\NSISPortable\App\NSIS\Include\zipdll.nsh" (UTF8)
!define: "ZIPDLL_USED"=""
Bad text encoding
!include: error in script: "C:\PortableApps\NSISPortable\App\NSIS\Include\zipdll.nsh" on line 77
Does anybody of you know how to put me in the right direction?
Thanks in advance to everyone who will help me
That file contains multiple languages but is not valid UTF-8 so you have to force the codepage:
!include /CHARSET=CP1252 zipdll.nsh

Electron-builder NSIS, embedding other installers

I have created a little electron program for one of my friends, it is a patcher for a private metin2 server of some sort. The game itself is really old so it requires a few redisturables to be installed.
[dxwebsetup0411 / dotNetFx35setup / vcredist_x86 ( i believe its a 2013 version) ]
I want to include them as an option at the end of the install (or even before it, doesn't really matter).
I have found a few examples how to do so but they are all for Standalone NSIS installers and when i try to include that script ( in the build/installer.nsh file ), the build process crashes, presumably because its not the main build script therefor adding Sections is prohibited (?).
Im really new to NSIS scripts and NSIS overall.
So far i only figured out how to put checkboxes and labels and so on in, with the help of nsDialogs, but as i looked at its documentation, it seemed that there are no option where i could do this.
Any help would be greatly appreciated.
EDIT :
My script currently is almost empty, I only changed the default directory, but anyway here is that:
!macro preInit
SetRegView 64
WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\Decay2"
WriteRegExpandStr HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\Decay2"
SetRegView 32
WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\Decay2"
WriteRegExpandStr HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\Decay2"
!macroend
Everything i know about electron-builder's NSIS main script and this included script is here :
Custom Script Example
NSIS- Electron Builder
It is definitely possible to embed other installers and execute them. See this example on SO:
Embedding other installers using NSIS
or these official NSIS tutorials/guides: https://nsis.sourceforge.io/Embedding_other_installers
Please post your script and build file(s) if you have some issue with your script and you expect specific answer.

msiexec parameters via setup.exe to create log not working

I'm trying to get a log from my install that uses a setup.exe. I can get a log with just setup.exe /V"/l\*v c:\temp\installlog.txt", but I want to pass the x parameter as well to get "Extra debugging information" and when I try setup.exe /V"/l*vx c:\temp\installlog.txt" I get:
1629: Invalid command line.
Any idea what I'm doing wrong? I have msiexec version 5 installed.
Ancient setup.exe: I tried with an ancient version of Installshield and the setup.exe for a Basic MSI worked as expected. I could pass in Setup.exe V"/L*v C:\Test1.log" and Setup.exe V"/L*vx C:\Test1.log" - both command lines worked and the resulting log files were different with the x adding more verbose nonsense :-). Verbose indeed.
Modern Suite Setups: I tried with InstallShield2018Premier.exe - a recent installer from Installshield, and it failed with that command line. I am pretty sure this latter file is an Installshield Suite setup.exe - it has to be. These suite setup.exe files (or whatever they are renamed to) are not the same as the setup.exe files generated for a single MSI file. There are some details about this here (just my observations, needs verification): Regarding silent installation using Setup.exe generated using Installshield 2013 (.issuite) project file.
So I guess the first thing I would verify is that you are not using a suite setup.exe (as opposed to a regular setup.exe launcher). However, it does look like the command line without the x parameter did work for you, and then this theory doesn't make any sense. Posting anyway in case you tested with another setup.exe or something like that. There could also be changes to the regular setup.exe which makes it fall over on the x now, but it worked in earlier versions.
Since the above does not seem like a real answer, how about some longshot suggestions?
Did you try to disable your anti-virus while running with this switch? Just to rule this out in case the x initiates something funky.
Did you try and verify similar results on another computer? Maybe a virtual machine? (a very basic, clean one).
Is this an Installscript MSI? I would build a Basic MSI wrapped in a test setup.exe to see if the behavior is the same for a vanilla MSI file.
All I can think of at the moment.
UPDATE: OK, a couple of things.
Installscript MSI projects are very buggy in my experience. I would use a Basic MSI if at all possible. The resulting MSI files are also much more compatible with corporate deployment requirements.
Maybe Try This: It is possible that you can "hack" the compiled Installscript MSI setup to be able to install without the setup.exe wrapper. So you extract the files with an admin install going setup.exe /a and then you use this trick: How to deploy the Installshield MSI without having to run Setup.exe - in order to run the extracted MSI file using the normal msiexec.exe engine. So then you just go msiexec.exe /i MyMsi.Msi /L*Vx C:\Test.log /QN and see what you get.
It is also conceivable that there is a setting in Installscript MSI projects where you can directly specify a command line to pass to msiexec.exe for testing. I have no access to recent Installshield version and can not help you with this. Documentation might give you a clue.
Have you tried this?
setup.exe /s /v"/lvoicewarmupx! C:\temp\install.log"

Easier way to create python executable standalone program in window

Creating a python executable in pycharm is harder than creating it in visual studio or creating a vb.net executable.
I thought I'd understand how to do this already but it looks like I have not.
I created a question regarding this in Dec of last year, here >> Create a simple python executable program and an icon to it - Hello World.
But I don't understand the answer or if it was answered completely. So I did my research again and found 2 helpful sites below that helped me create python executable without visual studio involved,
https://pythonhosted.org/PyInstaller/installation.html
https://pythonhosted.org/PyInstaller/usage.html#using-pyinstaller.
I followed the instructions exactly:
In command line, set path to C:\Python34\Scripts, then type pyinstaller "C:\Users\Desktop\PROGRAMs\TEST22.py".
This creates a TEST22.spec file in C:\Python34\Scripts and creates a folder TEST22 in C:\Python34\Scripts\dist and in there, are the TEST22.exe. I click on this executable to run the program, it runs completely fine. But when I copied the executable to the desktop, for example, it doesn't run. It seems like in the scripts folder there are files needed to run it and when it's a stand alone program there are no file to run it. Could someone let me know an easier way to create executable and please advise me on how I could fix it when the executable is copied to desktop or anywhere else and run it ?
Your answer lies in pyinstaller documentation. The dist folder itself is a standalone program directory. To get a single file exe with pyinstaller is not possible even thou pyinstaller has -F option for single exe since it dosnt contain data files.
I would suggest use py2exe and inno setup for creating installer

Nsis ExecWait command under the hood

There's a nsis exe that I know it using Nsis ExecWait to run a process.I need to hook it so I could replace the exe it Exec.
The problem is I'm not sure about what api to hook.And I've try dive into Nsis source codes till now find nothing:(. So Is there anyone familiar with nsis source codes give me some clue so I could find what ExecWait command under the hood API?
ExecWait is currently just CreateProcess+WaitForSingleObject.
In the NSIS source this instruction is called TOK_EXECWAIT in the compiler (script.cpp) and it maps to the EW_EXECUTE opcode in the installer stub (exehead/exec.c)...

Resources