INNO setup with nssm, getting Error 193: 0xc1 - batch-file

I am trying to install windows service using INNO and nssm. I followed instructions from this stackoverflow: Inno setup and NSSM service working integration
and it already worked, but suddenly when I try to start my service I get this error:
I tried on different pc and it starts it perfectly fine.
My code:
nssm install "SpotifyKeyboard" "hid_control.EXE"
nssm set "SpotifyKeyboard" AppDirectory %CD%
nssm start "SpotifyKeyboard"
del "%~f0"
I tried on diffirent pc and it starts it perfectly fine. But on this pc I get that error.

Related

NSSM can't start windows service

I'm trying to run my wpf service with nssm service manager. The problem is that using nssm I can install service, but then when I try to start it I get the following response in terminal:
MyService: Unexpected status SERVICE_PAUSED in response to START control.
Then in EventViewer I get the following error:
Service cannot be started. The service process could not connect to the service controller
Although I can start my service using NET commands, or using VisualStudio, but this problem occurs only with nssm...
Framework:
.NET Framework 4.6.1
Any suggestions on how to fix this issue?
EDIT 1
I created sample WPF service using https://learn.microsoft.com/en-us/dotnet/framework/windows-services/walkthrough-creating-a-windows-service-application-in-the-component-designer example. And the result is still the same.
EDIT 2
I managed to get NSSM error:
Cannot start service from the command line or a debugger. A Windows Service must first be installed (using installutil.exe) and then started with the ServerExplorer, Windows Services Administrative tool or the NET START command.
I don't get how nssm works now....
I found an answer!
I was too dumb to realize that nssm is a service manager, and I tried to run with it a windows service...
All I needed to do is to make a simple console application instead of service...
You can try to make NET COMMANDS to a bat file. Then Use NSSM to make the bat file to service.

How to fix SERVICE_PAUSED error on starting nssm server

So I need to run a custom server. It worked on other machines, but not on mine (all of them are on Windows).
My input:
nssm start custom-server
Error message:
custom-server: Unexpected status SERVICE_PAUSED in response to START control.
I tried to re-start it, but got the same message.
Use the following instructions to change I/O redirects:
nssm set [SERVICE_NAME] AppStdout [APP_PATH_INSTALL]\logs\service.log
nssm set [SERVICE_NAME] AppStderr [APP_PATH_INSTALL]\logs\service-error.log
Check the service log files to find the failure.
In my case, the failure was caused by a dependency on Python libraries.
As Garric15 states it is probably your install command.
This could be for example a StdOut redirect to a path / file that does not exist on your local machine.
Look in the Application event log for errors where the source is nssm around the time you installed the service.
The reason is because firewall is blocking the software which you are running as a service, start first software separately, it will ask you to add to firewall exclusions , then you can use it via nssm
Some scenario
App directory not provided or doesn't exist
nssm nssm set xyz-service AppDirectory "D:\Work\ShoppingKart"
File which is given for service may be corrupted (rebuild code)
The application trying to run is not proper or corrupted. Try to run without windows service once.
Program (.exe) file path not found (in this case look for the solution, or else give full path, if java not found even if it is there in env, just add full path)
I solved it by using no mws (Managed Windows Service?) release,
ex.
gogs_0.12.10_windows_amd64 works
gogs_0.12.10_windows_amd64_mws not working
The issue for me was there had been a Java update on my machine. The JAVA_HOME environment variable was now pointing to an invalid directory (i.e. the old Java version). Just needed to update the JAVA_HOME path and restart the solr services to fix it.
I was attempting to configure rclone as a windows 10 service. I fixed it including the rclone.conf archive inside the rclone folder.
In my case, the problem was that after the service was installed using nssm.exe, the program name was changed. This caused service to always go to paused state after start or restart the service, using either services.msc or nssm.exe command line.
Editing service nssm.exe startup parameters solved the problem for me.

How to set the environment variable CHROME_BIN when working in an IDE?

I'm trying to follow the AngularJS tutorial: https://docs.angularjs.org/tutorial. I use the IDE Cloud9.
When I enter npm test it returns No binary for Chrome browser on your platform. Please, set "CHROME_BIN" env variable. And the same message for FIREFOX_BIN.
How am I supposed to set these environment variables?
I've tried the following:
In the command prompt of Windows (on my pc, not in cloud9) I entered SET CHROME_BIN = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" but this didn't make a difference.
I also tried it when changing karma.conf.js to:
browsers : ['C:/Program Files (x86)/Google/Chrome/Application/chrome.exe', 'C:/Program Files (x86)/Mozilla Firefox/firefox.exe'],
but then I got the error Can not load "Script", it is not registered! Perhaps you are missing some plugin? so that doesn't seem to be the right way to go either.
If in Cloud9 I enter env SET CHROME_BIN = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" it returns env: SET: No such file or directory.
I also ran into the same problem using the Cloud9 IDE.
While, I didn't solve the Chrome problem, I went with PhantomJS, which worked with Cloud9.
To install on the command line:
npm install karma-phantomjs-launcher --save-dev
In the karma.conf.js file:
// start these browsers
browsers: ['PhantomJS'],
Add variable for the current user using powershell:
[Environment]::SetEnvironmentVariable("CHROME_BIN",'...', "User")
This is not exactly the same as what you want as variable will not be temporary but the effect will be the same.
Your own command will work if you execute it in the same shell as npm:
PS> $Env:CHROME_BIN = '...'
PS> npm test
...
I am using here Powershell syntax exclusively.
I am not familiar with Cloud9 but generally, to set variable up for the IDE you would need to run it from the script that sets the variable prior to launching the IDE (the same as I showed you with nmp above).

How to setup the proxy info in yypkg for sherpa.exe when installing Win-builds Project

I am trying to install the latest GCC compiler on windows 7 by using "Win-builds Project". Since the company I am working for has proxy. When I run the command win-install.bat. I got an error:
http://win-builds.org/1.3.0/packages/windows_64/package_list.el:
2014-02-21 11:39:44 ERROR 407: Proxy Authentication Required.
In the batch file, I found code:
yypkg -init
yypkg -config -setpreds host=%_YY_ARCH%-w64-mingw32
yypkg -config -setpreds target=%_YY_ARCH%-w64-mingw32
sherpa -set-mirror http://win-builds.org/1.3.0/packages/windows_%_YY_BITS%
I think the yypkg.exe does the initialization work and configs sherpa and let sherpa.exe to download and install files.
My question is how can config yypkg my username and password? I did google search, but I cannot find any info about yypkg nor how to config sherpa.
[enter code here][1]Proxy set up can be done via command line
How can I set a proxy server for gem?
set http_proxy=http://your_proxy:your_port
set http_proxy=http://username:password#your_proxy:your_port
set https_proxy=https://your_proxy:your_port
set https_proxy=https://username:password#your_proxy:your_port
These command snippets need to be entered on 'cmd.exe', and before running the wget, to download files manually via portable wget as described on page:
http://win-builds.org/doku.php/download_and_installation_from_windows
few IMPORTANT Pointers, after the packages have been downloaded manually, and running the 'yypkg-1.5.0.exe'
At first the Application UI is unresponsive, DO NOT CLOSE IT
After some time, change mirror dialog appears where you would need to type/paste the Local folders location(this is the folder where files were downloaded manually)
Local folder path needs to be similar to the following where 'package_list.el.tar.xz' file resides.
file:///C:/usr/MinGW/1.5.0/packages/windows_64
after that all works fine

Why do I get "The Application Failed to initialize properly" when calling candle?

I am writing a batch script in which I need to run a candle command:
candle.exe - present in wix installation 'bin' directory
I have set the path during my batch file load to the wix installation directory, and have checked writing
candle.exe abc.wxs -dplatform=x86 -ext WixUtilExtension
But on Windows XP it gives me an error:
The Application Failed to initialize properly (0xc00001235)" .Click on OK To terminate
On Windows 7, candle.exe works fine.
How can I resolve this?
I guess it is because i have not specified as to how to deal with different OS
This actually seems to be a result of not having .Net framework installed. Try installing .net 3.5 for Windows XP, or later for Windows 7 +.

Resources