Unix file associations of mime-type with multiple extensions - install4j

Unix File Associations is a welcome new feature in install4j 8.
I'm trying to register multiple file extensions as file associations with the same mime-type with the install4j 8.0.1 Unix Shell Installer.
The "Create a File Association" action only seems to accept one file extension so I initially tried adding multiple of these actions with a different extension but the same mime-type. This seems valid, but when it translates into the actual installation of the application it appears that the mime-info XML files being made are named with the same mime-type and so all but one get overwritten. This leads to only one file extension being associated with the mime-type.
I've also tried various separators (space, comma, semi-colon) in the file extension field, but this just ends up as a single unlikely looking extension in the mime-info XML file!
(e.g.
<glob pattern="*.ext1,ext2" weight="60"/>
)
The mime-info XML format allows multiple <glob> elements, so the mime-info XML file could contain, e.g.
<glob pattern=".ext1" weight="60"/>
<glob pattern=".ext2" weight="60"/>
but I can't see a way to get to this from install4j8.
Is there a way?

As of 8.0.1, this is indeed not possible. In 8.0.2, you will be able to specify multiple extensions separated by commas. Please contact support#ej-technologies.com to get a build where this is already implemented.

Related

How do I configure mplayer to use a default edl file name?

I want to configure mplayer to look for an edl when playing a video. Specifically, I want it to use "show.edl" when playing "show.mp4", assuming both are in the same directory. Very similar to how it looks for subtitles.
I can add a default edl in the config file by adding the following:
edl=default.edl
And this will look for the file "default.edl" IN THE CURRENT DIRECTORY, rather than in the directory where the media file is. And it isn't named after the media file either, and thus even if it did look in the right place, I'd have one single edl file for every media file in that directory.
Not really what I wanted.
So, is there a way, in the "~/.mplayer/config" file, to specify the edl relative to the input file name?
Mplayer's config file format doesn't seem to support any sort of replacement syntax. So there's no way to do this?
MPlayer does not have a native method to specify strings in the config file relative to the input file name. So there's no native way to deal with this.
There's a variety of approaches you could use to get around that. Writing a wrapper around mplayer to parse out the input file and add an "-edl=" parameter is fairly general, but will fail on playlists, and I'm sure lots of other edge cases. The most general solution would of course be to add the functionality to mplayer's config parser (m_parse.c, iirc.)
The simplest, though, is to (ab)use media-specific configuration files.
pros:
Doesn't require recompiling mplayer!
Well defined and limited failure modes. I.E. the ways it fails and when it fails are easily understood, and there aren't hidden "oops, didn't expect that" behaviors hidden anywhere.
Construction and updating of the edl files is easily automated.
cons:
Fails if you move the media around, as the config files need to full path to the edl file to function correctly.
Requires you have a ".conf" file as well as an EDL file, which adds clutter to the file system.
Malicious config files in the media directory may be a security issue. (Though if you're allowing general upload of media files, you probably have bigger problems. mplayer is not at all a security-hardened codebase, nor generally are the codecs it uses.)
To make this work:
Add "use-filedir-conf=yes" to "/etc/mplayer.conf" or "~/.mplayer/config". This is required, as looking in the media directory for config files is turned off by default,
For each file "clip.mp4" which has an edl "clip.edl" in the same directory, create a file "clip.mp4.conf" which contains the single line "edl=/path/to/clip.edl". The complete path is required.
Enjoy!
Automatic creation and updating of the media-specific .conf files is left as an exercise for the student.

How can I find out what file mode VSCode is using for an open file?

I was trying to get yapf configured for a Python project, and so I created a .style.yapf file, which VSCode did not recognize by its extension. I thought it was in TOML format, but when I changed the file association for .style.yapf to TOML, the parser shows an error (because values aren't quoted). So I tried changing the name of the file (not really a solution, because the tool is looking for a file with that name), and found that if I change it to a name ending in .cfg, VSCode seems to parse and highlight it appropriately. Unfortunately, there doesn't seem to be anything in the list of file associations corresponding to this file mode.
I expected to find a cfg mode in the file associations list, but there wasn't an entry with that name, nor was there an entry that used the same gear icon displayed next to the open file name in its tab (which I have been assuming is an indicator of the mode that VSCode is using to display and format the file).
Is there any way for me to get VSCode to tell me what the current file mode is for an open file? Or give me a list of the default associations?
I'm more interested in understanding the tools in general than solving the one minor annoyance that sparked the question, but I'll settle for a solution to that problem, too.
Edit: Here's the content of the .style.yapf file in question:
[style]
based_on_style = google
If I rename the file to .yapf.cfg (or any other name ending in .cfg, I believe), it gets handled properly, but all of the file associations I've tried (including ini, Properties, and TOML) indicate an error because there are no quotes around google.

Is it possible to extract metadata such as Content Created date from files - I can't get this with PowerShell

I need to extract the "Content Created" date out of thousands of files, but haven't been able to find a way to do this using PowerShell / other Command Line utility.
Does someone out there know a way to obtain this metadata? If so, please can you advise me. Thanks.
I've looked at various resources online, including this site, but haven't been successful thus far.
Here's a screenshot explaining what I'm trying to do.
I've been unable to find a native powershell cmdlet which does what you want. However, I found this article: Use PowerShell to Find Metadata from Photograph Files and the script it used: get file meta data function.
The article talks about image files, but the function is not specific for image files.
I tested it out on a folder containing a Word and an Excel file and the returned Metadata from the Word file contains the Content Created date. The Excel file does not contain/return that value. This is not unexpected as the Details tab of properties for the Excel file does not contain a Content Created value so it seems to be specific for Word files, and maybe some other file or document types.
Update:
You write that you need to extract this info from thousands of files, but if those files are anything but Word-files you probably won't be able to do that.
As far as I can tell this should work with the file types exposing the type of metadata you want. However, it seems that the ContentCreated property is unique to Word. I tried adding a text file (.txt), Acrobat PDF (.pdf), MS Access (.mdb), Excel (.xlxs) and a Word doc (.docx) file to my test folder and the only one that has/returns that metadata property is the Word file.
You should also be aware that the script seems to return metadata localized, so for me to programatically get the info i wanted I had to pipe the output of the script to Select-Object -Property Name,'InnehÄll skapat' (which is the Swedish name for Content created). So if you're running on a non-english system you may need to check what the output looks like before creating your Select-Object statement.
PowerQuery in Excel 2013 or later (data tab). Connect to data> Folder.

Can we change any file type using variable substitution rather than just JSON or XML

I want to change a js file and html file using release pipeline in VSTS. What I see is VSTS only allows JSON and XML config file transformation but I want to change other types(formats eg: .cs, .js, .ts, etc) of file as well.
Earlier we were using octopus deploy which has the option to transform these files.
Please let know if you know some other way to change the file in pipeline itself..
Can we change any file type using variable substitution rather than just JSON or XML
You could use Replace tokens from the Marketplace:
https://marketplace.visualstudio.com/items?itemName=qetza.replacetokens
to change other types files.
You define the desired values as variables in the Release Definition and then you add the Replace Tokens task and configure a wildcard path for all target text files in your repository where you want to replace values. The token that gets replaced has configurable prefix and postfix (default are #{ and }#).
So, the format of variable in those files are #{TestVar}#.
Check my other thread for some more details.
Update:
We do not want to use third party tools from marketplace, do we have
any way within the scope of existing microsoft tools.
I am afraid there is no such directly existing Microsoft tools to change other types files at this moment, you could develop your powershell scripts to replace file content.
Check this thread for some more details.
Hope this helps.

Automating Localizable.strings?

So, in my project I have 10 languages, and 10 Localizable.strings files.
I just created Localizable.strings files, a file for each language. Now they contain "key" = "value" pairs, and both keys and values are in English (default language).
My languages are all translated and stay in Excel files.
The question is, how can I insert all my languages in those files faster than just copying each word manually or writing a script for that?
Maybe there is a existing tool for this already?
Thanks.
I found an easy way to compose localizable.strings files from Excel documents.
In the Excel document, in specific columns I insert " " = " " symbols. It's easy to do for all the words by dragging Excel cell down from the corner, so that it copies stuff from that cell to all the cells you drag it to. (sorry for messy explanation)
Thus the document contains the same symbols and words as localizable.strings does.
Than I just copy everything to the text file, remove tabs, change extension to .strings.
(no comments saved unfortunately).
EDIT:
You can copy the stuff from Excel to Sublime Text, then Find & Replace tabs if any. Copy resulted stuff into proper Xcode .string file.
One application that will really save you a lot of time by automating and streamlining localization procedure is Localization Suite. I do not know if they support importing from excel (to save you time transferring your string pairs) but it's free and seems like a complete solution.
I had an internal script at work for doing that tasks in iOS and Android, and I've just opensourced it as a Gem. You can take a look at it here: http://github.com/mrmans0n/localio
It can open spreadsheets from Google Drive and local Excel files as well, like requested.
You just would have to install the gem
gem install localio
And have a custom DSL file in your project directory, called Locfile, with the info referring to your project and the localization files. An example in your case, where an Excel file is used, could be as simple as:
platform :ios
source :xls, :path => 'YourExcelFileGoesInHere.xls'
output_path 'Resources/Localizables/'
The .xls file should have a certain format, that probably is very similar to what you have right now. You just have to clone the contents of this one and fill it with your translations: https://docs.google.com/spreadsheet/ccc?key=0AmX_w4-5HkOgdFFoZ19iSUlRSERnQTJ4NVZiblo2UXc
Hope this helps.
Here are the steps i followed:
change the extension of .strings to .txt on windows
open excel and go to File > Open
Choose the file to open. This should present an import wizard
Follow the steps and specify the delimiting character as =
You're done