How to make own language file in NSIS? - nsis

I want to make my own language file for my installer. I want to make my installer which will support two languages "English" and "Hindi". But there is no language file for hindi. So I want to make my own language file for hindi. Can anyone tell me how to make it and how to link it with NSIS? And what is ".nlf" files e.g "English.nlf" present in the NSIS Contrib folder?

The .nlf files inside Contrib\Language files are storing all default dialogs used by NSIS. The .nsh files in the same folder are used by installers with Modern UI. I'd clone the files for English translation (or any other language you prefer as starting point) and change all the strings inside.
For your convenience, there are packages available for Sublime Text and Atom, that let you jump between each translation field.

As suggested by idleberg, you just copy one of the .nlf and .nsh files and translate the strings but you are in luck, the NSIS fork already has a almost complete translation.

Related

What language is used in Linux scripts in dotfiles?

I'm trying to figure out which language is used in Linux scripts to make the system more personal? I mean things like you put in the dotfiles — like .vimrc, or .zshrc — or to make a function for the terminal (like one that compiles a .tex file with bibtex and then pdflatex and then opens that .pdf with some reader).
What you call dotfiles are just configuration files of one or another program. So the "language" of each of those configuration files depends on the program that is going to use it.
In fact, that doesn't have to be a language, in general, hence the quotes in the previous paragraph. Those config files just have to match the format that the program that uses them expects. This occasionally means that configuarion files are required to use a specific language; an example is .vimrc, which has to use the vimscript language (aka VimL).
I think the term "Linux Scripts" will cause misunderstandment in here.
These dotfiles have a particular syntax for each one, but it's not a programming language.
It's allways a good idea to read the official documentation.
https://www.vim.org/docs.php
https://www.zsh.org/
For vimscript learning, I had a good experience with this one:
https://learnvimscriptthehardway.stevelosh.com/

Add file after generating the installer executable

I would if we can add some files(text or executable) to a NSIS installer with a tool(or not) after the package is done.
Thank you for your help
You cannot really append extra files after the compiler has finished. You can however append a small text string if you need to embed some sort of id/hash/serial number. This data can be read with the ReadCustomerData function from the NSIS wiki.
You can compile installers on Windows and POSIX based systems so you can build installers anywhere if you absolutely need to add a file that does not exist on your system...

Inno Setup : How to change language file depending on code

I use my own languages files (.isl) instead of using the default languages files of Inno Setup. It permits me to customize some messages. But now, I would like to have two versions of each language files, one in case of first installation and one in case of update, but, is it possible to choose a file from the code? If yes, how to do it?
Maybe there is some better way for changing the messages than change the languages files depending on the type of installation, if yes, I would like to know what to do.
Thanks
Add the alternative texts to [Custom Messages] section:
https://jrsoftware.org/ishelp/index.php?topic=custommessagessection
Then in Pascal script, when upgrading, update the respective GUI element with the alternative translation loaded using CustomMessage('MyAlternativeUpgradeString')
https://jrsoftware.org/ishelp/index.php?topic=isxfunc_custommessage

syntax highlight (.tmLanguage) in Sublime Text 3 for packages

I work on this plugin
Syntax highlight does not work with Sublime Text 3 when plugin is installed using package control.
Error loading syntax file "Sublime Text 3/Installed Packages/robot.tmLanguage": Unable to open Sublime Text 3/Installed Packages/robot.tmLanguage
The plugin is under Installed Packcages/Robot Framework Assistant.sublime-package, the file 'robot.tmLanguage' in inside Robot Framework Assistant.sublime-package archive.
Here is how I set paths
https://github.com/andriyko/sublime-robot-framework-assistant/blob/master/rfassistant/init.py
My question is similar to this thread, but in my case the plugin is installed as archive(.sublime-package) not folder with with files.
I am not sure that my path settings mentioned above are correct in python3.
How can I refer to tmLanguage file that is inside .sublime-package file?
Where should I put that file? It is totally confusing why does it work on Sublime Text 2 and Sublime Text 3(when installed into dir from github) but does not work when installed via Package Control.
So, how do I set path to tmLanguage file and where should I store it. Just want to clarify, that it works fine when plugin is installed from github zip file(because I put it's content into RobotFrameworkAssistant folder under Packages directory). It does not work when plugin is installed via Package Control.
Quick summary of my manual solution of adding custom .tmLanguage files based on others' suggestions:
Put the myLang.tmLanguage file into a folder with your desired syntax
name.
Zip the folder so that it's named myLang.zip
Rename the zip archive to myLang.sublime-package
Put the myLang.sublime-package into the Sublime 3 packages folder. It will now appear in the sublime syntax highlighting menu.
Based on ST3 docs, I can't seem to find an alternative to this manual method right now, but it will work.
Package control will likely do everything you need behind the scene
Do you need the content of the tmLanguage file? If so, you shouldn't be accessing it directly. Instead, you should be using sublime.load_resource(name), where name is something like Packages/Robot Framework Assistant/robot.tmLanguage. If you are just trying to set the file syntax, you should be using view.set_syntax_file(syntax_file), where syntax_file is like name for the resource. I did not look at your plugin in detail, so please clarify what you are trying to do if both of those answers are incorrect.
As a side note, based on that error, you would probably see issues in ST2 also. You are only looking at the root packages folder, not in your package.
In ST3, jps decided to make plugins runnable from .sublime-package files, rather than needing to be extracted. These files are simply renamed .zip files. Updates do need to be made if you are accessing resources within your plugin, but the API has been extended to support it.
This isn't a great list, but it covers some of the changes in ST3 from ST2.
http://www.sublimetext.com/docs/3/porting_guide.html
The issue seems to be solved. Please refer to this fix.
Why I had problems with syntax settings(.tmLanguage) in ST3?
Because it is totally confusing and not clear from ST3 docs where that file should be located.
(Even if it says that files lookup is continued in Packages directory if file was not found in Installed Packages).
There are two 'main' folders under Sublime Text 3 directory: Installed Packages and Packages.
When the plugin is installed using Package Control it goes into Installed Packages directory packed into archive file called like Robot Framework Assistant.sublime-package (which is actually ZIP file).
The robot.tmLanguage file (syntax file) is inside Robot Framework Assistant.sublime-package.
So, in few words, my question was: how to refer to that file (what path should be provided to view.set_syntax_file method)?
Unintuitive, but I should refer to non-existent path Packages/Robot Framework Assistant/robot.tmLanguage. Actually, in my case the Packages directory contains only Users folder. The only thing, that I can guess is that folder name should be the same as package name(Robot Framework Assistant in my case).

is it possible to tell NSIS to setof files listed in a config file?

I have to download different files from a location on the network, http, but the file names versions I want to supply in a configuration file. is this possible ?
You can read from files with the NSIS ini instructions, manual parsing with FileRead or use one of the helper macros.
You can download files with the INetC plugin...

Resources