Create a custom file extension in VB 2008 - vb.net

I have been doing a lot of searching on the web and cant seem to find a clear way of creating a custom file extension. I know to associate the file extension to a certain program, but how do create a format for the custom file extension?

You can do that as well through setup application as described in Walkthrough: Deploying a Windows-based Application, and you can pick any extension you like. I prefer to use abbreviation created from application name, and try to find if this extension is not in use. If extension was in use, then old reference (link between file type and application) will be broken. Use of 4 characters extensions will help with better chance of extension to be unique.

Related

how to config Intellij Idea live template's applicable context?

I want to create a live templates group for my custom file type, but when i pick a applicable context, there are a list of kind of file type or language but my custom file type.
Is the list predefined and can not extend?
The available context types depend on the enabled plugins. It says so (and not much more) here in the Jetbrains help page: https://www.jetbrains.com/help/idea/2016.3/live-templates-2.html
If your custom file already has a plugin, maybe all you have to do is add it. For example adding the plugin Perl adds Perl5 to the list.
Otherwise you need to look into how to create an extension. More on that here: http://www.jetbrains.org/display/IJOS/Writing+Plug-ins
Good luck!

What does .dist used as an extension of some source code file mean?

Examples in the Zend tutorial:
phpunit.xml.dist
local.php.dist
TestConfig.php.dist
.dist files are often configuration files which do not contain the real-world deploy-specific parameters (e.g. Database Passwords, etc.), and are there to help you get started with the application/framework faster. So, to get started with such frameworks, you should remove the .dist extension, and customize your configuration file with your personal parameters.
One purpose I have seen in using .dist extension, is to avoid publishing personal data on VCSs (say git). So, you, as the developer of a reusable app, would use your own configuration file, but put the de-facto get-started config data in a separate .dist-suffixed file. (See Symfony2's documentation, 4th part)

How can you _create_ a text file in Wix?

Is there any way to create a new text file and write to it using Wix? I have come across elements that will allow me to work with Xml files and Ini files, but nothing for a plain text file.
The root of the problem stems from the fact that we're using a third party library that reads from its own custom configuration file, which really ties my hands as to what the text file can look like. The configuration file is similar to an Ini file, minus the "sections." And I've noticed that Wix handles Ini files by always placing them in the system folder, which won't work for our needs.
The data that needs to be written to the configuration file is gathered at run-time, so there's no opportunity to simply lay down a pre-configured file.
I would be willing to accept a Wix extension to accomplish the same result if one exists, but haven't come across one yet.
There is no built-in feature in Windows Installer for this. You'll have to write code to do it and invoke that code with a custom action.
The IniFile element can write .ini files anywhere; use the #Directory attribute to specify which directory it should go in. If the library ignores [section] lines, you can use anything as the #Section attribute value.
You might want to have a look at this project. It contains the collection of WiX extensions and custom actions, and I suppose it also has CA to read and write text files. Try it out - it is claimed to be tested and proved by using in enterprise installations.

Content types understood by an application

Given an application path (or NSBundle to an application, etc), is there a way to easily/efficiently determine what content types that application can open?
My initial attempt was to read the application's Info.plist file and extract the content types listed under the kUTExportedTypeDeclarationsKey key. However, there are some flaws with this approach which I haven't been able to work around.
Not all applications use this key. For example, BBEdit does not, but instead lists a whole bunch of recognized file extensions.
UTIs are case-sensitive. Pages, for example, lists com.apple.iWork.Pages.pages as an exported content type, yet no Pages document actually has that type listed in its content type tree. Documents use com.apple.iwork.pages.pages, which is defined by the iWork quicklook generator (at /Library/QuickLook/iWork.qlgenerator).
In know that with some of the LaunchServices functions (LSCopyApplicationURLsForURL(), LSCopyApplicationForMIMEType(), etc), I can get the applications that can open a file (or a file type), but I'd like to do the inverse. (Perhaps I'll have to resort to parsing the output of lsregister -dump?)
Perhaps a simpler way to phrase the question would be: Given an application, what's the easiest way to find all files that it can open?
Any suggestions?
Take a look at LaunchServices and the provided LSCanRefAcceptItem() API.
It seems using the LSItemContentTypes key is the preferred method post-10.4.
Apple: Document-Based Applications

How do I do a search and replace on a configuration file using Wix?

Some code I inherited has its "configuration" (if you can call it that) embedded into its PHP and ASP (don't ask) code. Because its not an XML or INI file, I'm having the darnedest time figuring out how to modify these files at install time. If I could, I'd like to do a simple search and replace. I've read elsewhere (WiX Search and Replace on a configuration file) that I should just write a Custom Action. I'd rather avoid it if I could since the code I wish to configure is deprecated and I don't want to create yet another project to support this code.
So is there a way to do this without writing a custom action. If not, is anyone aware of any custom actions that are already built that could help me with this task?
Windows Installer has built-in support for INI files and WiX / InstallShield has extensions for supporting XML files. InstallShield has an additional extension that supports "Text File Changes" with what they call Replacement Sets. ( Find What, Replace With, Match Whole Word Only, Match Case, Replace Once Only ) I don't think it supports RegEx.
So unless you are going to switch to InstallShield you are going to have to write a custom action or refactor the text file to be XML.