Can I get the start-up arguments in Neutralinojs? - neutralinojs

I'm trying go make an application able to run a file type, I want to get the path to the file which the user opened the app with.

You can use NL_CWD to get the current working directory. See more information about Neutralinojs global variables here.

Related

Ignore settings.json file when using nexe or pkg

I created a Discord bot i want to share with others but the community i want to share it with got a bad habbit of removing credits and so on.
What i am trying to do is compile my bot script in to native code i have tryed nexe, and that works fine, but i dont want it to encode the settings file, where the users need to add there bot token, and channels that the bot should work with.
I Tryed looking in to PKG to but i can't find a clear answer on how to do this, is there anyone out there that can lead me in the right direction?
A couple ways around this:
Have the user pass in the settings file location as the first argument to the binary: ./binary ./settings.json
Have the user set an environment variable with the settings file location: BINARY_SETTINGS=/home/user/settings.json ./binary
Expect the settings file location to be the current directory of the binary
For example, to do 3 with pkg, you can use the suggestion in the docs:
On the other hand, in order to access real file system at run time (pick up a user's external javascript plugin, json configuration or even get a list of user's directory) you should take process.cwd() or path.dirname(process.execPath).

How to hide PHP code on the server from other person under root?

Good day!
There are PHP scripts, classes, configs. All this stuff is interconnected, I need to give a person access to the server so that he works (started under the root) with these scripts, while changing only the config files, and in order to not be able to view the source code.
I've researched various free obsfukators which converting code into something:
<?php include(base64_decode('Li4vY29uZmlnLnBocA=='));include(base64_decode('cHJpdmF0ZS92ZW5kb3IvYXV0b2xvYWQucGhw'));$krc_5bf7f45b=[];foreach($bhi_6f9322e1as $xol_e8b7be43){$xol_e8b7be43=explode(base64_decode('Og=='),$xol_e8b7be43);try{$uic_c59361f8=new \xee_d9cb1642\cko_659fc60();$uic_c59361f8->ldc_aa08cb10($xol_e8b7be43[0],$xol_e8b7be43[1]);$krc_5bf7f45b[]=$uic_c59361f8;}catch(Exception $wky_efda7a5a)
What if the files of configs have variable names and it turns out that when obfuscating the main working code, the variables have different names? Not to force the user to run through the obsfukation corrected config every time? So far, this option seems the only one.
Is it possible inside the server under Ubuntu to somehow limit the ability to copy or view or download certain files or make some other methods of protection-hiding, but at the same time with the ability to run this code. It was thought to hide the code somewhere in the depths of the file system folders, calling them random names, and run them somehow through the symlinks by the file name or something like that. Is it possible to?
Option not to provide root access to the server, but to launch via the browser, to give access only to FTP to upload the config to a separate folder. But there are a number of points - all scripts run up to a week, and must be executed as root. How to solve it?

Error in Preparing your Environment: The system cannot find the path

I am trying to start my first API with Spotify.
I am using this site for my walkthrough.
I have downloaded the specified version of Node.js, and I have saved the code provided into a sublime file under the name server.js, and stored on the desktop in a folder called njtest.
On the step "Preparing your Environment", I run the cmd prompt and I get the error "The system cannot find the path specific".
Am I missing prompts in my js file and my cmd prompt?
You need to specify the PATH. If you're using Windows go to the start menu and type in Edit the system environment variables. From there go to Environment variables. Then in the system variables section, find where it says PATH and double click it. Click "New" and type in the path (should be whatever you saved it under. Something along the lines of C:\Node.js\bin) Remember that PATH's are case sensitive. If you have any more detailed questions about specifying the path, a quick internet search should yield many answers. Hope this helps!! Good luck and don't give up.

Can I keep the application settings when updating with installshield?

I finally managed to get my application updating through installshield LE, without the user having to uninstall manually first, what I am now wondering is:
Can I get the installer to use the application settings from the previous install, so the users saved settings don't change, causing the user to enter their settings every time there is an update. But at the same time, add any new settings to the config file.
Is there anyway to get the installer to not update certain files, for example, the database file is held in a folder called 'db' inside the program files directory, I obviously don't want the users database getting overwritten with a blank one.
Thank you.
Im not sure what programming language you are writing in, but I had this concern with a C# application I wrote. I see 2 easy ways of doing it:
1) With C# you can setup application setting variables that get written to an XML file in the users Application Data (on WinXP) directory. The nice thing about this is that writing to and reading from the settings file is really easy through the API:
To save and store a variable:
Properties.Settings.Default.UserName = UserName_txtbox.Text; // save contents of UserName_txtbox to UserName setting variable
Properties.Settings.Default.Save(); // write variable to file
To restore a variable:
UserName_txtbox.Text = Properties.Settings.Default.UserName; //load contents of UserName variable to UserName_txtbox
Because the file that contains these are not included in the installation directory of the application, they are preserved.
If you are using a different programming language, you can try to implement the same concept.
Create a settings file that your program updates externally from the install location. (Perhaps it can be in the install location. Im not sure how your installer "updates". Does it replace files or uninstall the old version and install the new version automatically? Play this this to find out...)
Your settings file can be a simple txt file, a bin file, an XML file, etc. Anything that you can read and parse easily. Then you can load settings from the file when the program loads and save settings to the file when the program exits.

How can I tell which workspace a directory is in?

I need to know which workspace the directory I am running the batch script is in, so I can get a list of files that are checked out in that workspace.
Is there an easy way to do this?
I am hoping I don't need to get a list of all workspaces and then manually go through them trying to figure out which one my current directory is a child of.
I am doing this on Windows.
The name of your client is set by your P4CLIENT definition or the '-c' argument, not by your current directory. Your current directory might, however, influence the choice of a P4CONFIG file with client-side settings. Try 'p4 set' to see your client-side configuration settings.

Resources