How to deploy NodeJs application in Production Server without source code - node.js

We are developing a nodejs application, we have tried to deploy nodejs application without source code by using PKG plugin(https://www.npmjs.com/package/pkg) and nexe. Both are creating EXE file by bundling the source code. Now how to read configuration file(which is stored database connection etc) in production, because configuration file will be part of exe. And we will not able to modify the file.
Do we have any other tool to handle production deployment without source code and having separate application configuration file.

Related

How can I use the ExportLogic command in EWL to deploy an application?

What exactly are the steps to take after running ExportLogic in the Package Manager Console? Does this do anything for updating the database on the server?
To deploy an EWL system using ExportLogic, the first step is to do a release build of your solution.
When that's done, run ExportLogic, which creates a Logic Packages folder in your solution's folder. Logic Packages will contain:
Server Side Logic folder - contains the files you need to put on the server for your system to run correctly, minus installation-specific config files
Client Side Application folder (if your system contains a client-side app) - contains the files needed to correctly run your system's client-side app, minus installation-specific config files
Copy the contents of Server Side Logic to your server, then create an Installation folder inside the Configuration folder and put your installation-specific config files in it.
If your system has a database, execute the portion of Configuration\Database Updates.sql that has not already been executed against your live database.
Finally, for each web application folder you copied to the server, create an IIS web site or virtual directory pointing to it.
If you're interested in automating some/all of these steps, there are APIs within EWL that may help.

How to Create a setup file with Database script in C#

I am trying to make a setup file in C# desktop application project so i use Sql express i want to run the script of the database while install setup file or is there ant way to add the database script inside the setup file to run automatically

Web site references a console app which uses NHibernate to talk to database

I've written a console app which basically downloads an XML file, manipulates it and puts the data into a database. This app uses NHibernate and MindScapes NHibernate designer tool. Which works fine when I run it as a stand alone thing.
Now I want to create an MVC website and when a certain button is clicked on that website, I want it to trigger the console app to download the appropriate xml file and do its thing.
I get an error:
Could not find file
'C:\Dev\WagerWatcher\WagerWatcherWeb\bin\hibernate.cfg.xml'.":"C:\Dev\WagerWatcher\WagerWatcherWeb\bin\hibernate.cfg.xml
WagerWatcherWeb is the website, So I think it's looking in the WagerWatcherWeb project for a file which is actually located in the 'WagerWatcher' project.
Is it as simple as changing an app.config file somewhere to redirect to the actual file? and if so, where abouts? I can't fins it to save myself,
Just place (copy) the configuration file (used in your console app) to deployed web-app folder. Read: 3.8. XML Configuration File
An alternative approach is to specify a full configuration in a file named hibernate.cfg.xml. This file can be used as a replacement for the <nhibernate> or <hibernate-configuration> sections of the application configuration file.
While the web application is the "run-time" (just calling the API of your console application) it must be provided with all configuration. Even for referenced libraries...

console application settings using batch file

I have created a console application which sends emails to people by selecting their email addresses from database. I have used entity framework for database connectivity. I have stored connection string and SMTP settings in app.config. I have called this application exe from a batch file. I have called this exe file of console application from a batch file. I have provided client with exe and batch file. This exe uses my gmail smtp settings and connection strings. How can client update the connenction string and SMTP settings of this EXE ? Are there any options in batch file to build the exe when settings are changes in app.config ? Please suggest.
Regards,
Asif Hameed
The entire purpose of the .NET configuration feature is that you do not have to rebuild the application.
When you properly use the application settings, a file xyz.exe.config is created in the output folder (where the xyz.exe is after compiling). Just copy the xyz.exe, the xyz.exe.config and the batch file to the client and change the values in the xyz.exe.config file accordingly.
App.config settings are runtime settings -> they will be read when running the application (not when compiling).
This means that if you modify the settings inside app.config they will be visible/read the next time the application is launched.
When you compile the app.config will be converted to YourConsoleApplicationName.exe.config (e.g. my console application is called ConsoleApp1, the generated exe will be ConsoleApp1.exe and the config file will be ConsoleApp1.exe.config) so make sure you distribute this along with the exe and bat (the .exe.config should reside in the same directory as the .exe).
Once the client gets the above files he/she can modify the settings inside the config file and deploy the application with the modified settings inside it's network
You could modify your batch file to modify the content of the app.config before running your application (e.g. switch depending on the authenticated user), but this seems too much trouble (doesn't really make sense because you could do all this easier from the console application).

main considerations while publishing application using SQL server Database

I want to ask about the main considerations we have to put in mind when publishing application using SQLServer database?
I ask this question because I faced a problem when I developed an application using SQL server Database in C# and used it in another machine. The problem is an exception happen in launching the application.
This is the exception message:
<b>"The ConnectionString proberty has not been initialized"</b>. The ConnectionString is in App.config and assing while form loading.
This is the ConnectionString:
<b>"Data Source=.\SQLEXPRESS;Initial Catalog=test;Integrated Security=True;Pooling=False"</b> and it is in this file: appName.exe.config
The application is Desktop application and it's not need for installation just click .exe and it should connect to the existing SQLServer database with the ConncetionString in the appName.exe.config file.
The best way to deploy any type of application will be creating a setup.exe or .msi file.
Since this will ensure the important files which will copy to the target machine. It also provides a well structured file hierarchy along custom action which we can program each and every steps of installation.
It is always good to keep the connection properties in a config file, which helps to change the configuration settings without building the project. The exe will reads data from the config file, so if we changed the values then also it will works fine. While creating the setup project add the configuration settings and deploy or it is also good to have a common setup msi and different config files.
For example the database may be different for servers like DEV,QA,Staging etc. For each sever the msi will be same but the connection string will be different. So there is also a way to create self extracting files which will update the config files . For QA,DEV,Staging etc different self extracting files will be there. by running those files, it is possible to update the server details and authentication details. By providing msi and extracting files, users can install the application very easily

Resources