Install service error code 1920 - Advanced Installer Community
413X
Posts: 11
Joined: Wed Jun 13, 2018 9:46 am

Install service error code 1920

I have a very straight up installation I would like to work.

1. Files to installation folder. Some config files goes to a folder in ProgramData which the service will read at install.
2. Install my service with argument /I that is. Without Advanced installer I would just install it by: myService.exe /I

I fail the ServiceInstall with the errorcode 1920.


So. I've added my files. I've used the new service wizard. Added /I in the arguments on the Services to install. What exactly am I missing here?
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Install service error code 1920

Hello,

Please note that the "Services" feature in Advanced Installer can be used only for native Windows services. Since your service is installed in a custom way, you can try using custom actions.

For example, you can create a .BAT file with the following content:

Code: Select all

myService.exe /l
After doing so, you can add the .EXE and the .BAT file in the "Files and Folders" page and then follow our "How to launch a CMD or BAT file" article which I think you may find useful.

Hope this helps.

Kind regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
413X
Posts: 11
Joined: Wed Jun 13, 2018 9:46 am

Re: Install service error code 1920

nvm
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Install service error code 1920

Hello,

Do you require any additional help? If yes, please let me know.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
413X
Posts: 11
Joined: Wed Jun 13, 2018 9:46 am

Re: Install service error code 1920

Okay so I had another issue but solved it, so i wrote "nvm". But now I have yet another one so here goes:


In my installation I am attempting to install a service with a .cmd-script. I'm unsure where exactly is the most correct to place the "launch file" is it pre "Finish execution" after it or after InstalFinalize? Anyway, onto the real stuff. My cmd-script requires elevated permissions as administator because it is launched from a directory with username/password restrictions.

So in my custom action: Run as administator is ticked.
File to launch: [APPDIR]\path\to\file\myScript.cmd
Command line: [ALL] [MY] [INPUTS] "As well as a text like this"

However, during installation it fails. Running the script after the failed installation or on its own elsewhere works through elevated cmd.exe works.

The error log is in swedish but you guys probably recognize the error codes;

Åtgärd 14:47:14: InstallServer.
Åtgärd börjar 14:47:14: InstallServer.
CustomAction InstallServer returned actual error code -1 (note this may not be 100% accurate if translation happened inside sandbox)
MSI (s) (48:7C) [14:47:14:496]: Note: 1: 1722 2: InstallServer 3: C:\Windows\Installer\MSI78.tmp 4: /RunAsAdmin /HideWindow "C:\Path\to\my\File\InstallServer.cmd" input1 input2 input3 "Server"
Fel 1722. Det har uppstått ett fel i detta Windows Installer-paket. Ett program som körs som del av installationen avslutades inte som förväntat. Kontakta supportpersonal eller leverantören av paketet. Åtgärd InstallServer, plats: C:\Windows\Installer\MSI78.tmp, kommando: /RunAsAdmin /HideWindow "C:\Path\to\my\File\InstallServer.cmd" input1 input2 input3 "Server"
MSI (s) (48:7C) [14:47:16:355]: Produkt: MyProductName -- Fel 1722. Det har uppstått ett fel i detta Windows Installer-paket. Ett program som körs som del av installationen avslutades inte som förväntat. Kontakta supportpersonal eller leverantören av paketet. Åtgärd InstallServer, plats: C:\Windows\Installer\MSI78.tmp, kommando: /RunAsAdmin /HideWindow "C:\Path\to\my\File\InstallServer.cmd" input1 input2 input3 "Server"

Åtgärd slutar 14:47:16: InstallServer. Returvärde 3.
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Install service error code 1920

Hello,

Indeed, it seems that your custom action is failing. There can be a multitude of reasons of why this happens.

Since you have said you are not sure where to schedule the custom action, here is a little explanation for you: since you call the bat file by the following path "[APPDIR]\..\..\yourbatfile.bat", it means that your bat file has to be present on the system at the moment when you try to launch it. With that being said, you should schedule your custom action after "Add resources" action group, with an "Execution Time" of "When the system is being modified (deferred)".

Please see the following screenshot for your reference:
LFCA.PNG
LFCA.PNG (52.82 KiB) Viewed 6219 times
Please let me know if this helps.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
413X
Posts: 11
Joined: Wed Jun 13, 2018 9:46 am

Re: Install service error code 1920

I did as you suggested and failed yet again. I even tried hardcoding the path and variables in AI with full paths and it failed. When the error prompts, I opened up the elevated commandline and ran the same .bat script exactly as AI should and it works fine. I've tried ticking the "Run as administrator" as well as "Run under localsystem account with full privileges" without success.
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Install service error code 1920

Hello,

In order for me to further investigate this, could you please send me a copy of your .aip file by e-mail at support at advancedinstaller dot com? Also, alongside with that, could you please also send me the .BAT file and the full verbose log of the installation process?

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
413X
Posts: 11
Joined: Wed Jun 13, 2018 9:46 am

Re: Install service error code 1920

I concluded that the suggested method does not work. I resolved it by 'Call function from attached native dll" with Attached DLL: C:\Program Files (x86)\Caphyon\Advanced Installer 15.6\custact\x86\aicustact.dll with the function CreateExeProcess with the Action data with my exe followed up by the command line options. This takes place after installFinalize.
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Install service error code 1920

Hello,

Thank you for your followup on this and for sharing your solution. This may be of help for further users facing a similar scenario.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”