file-association

How do I register a file association in Ubuntu

白昼怎懂夜的黑 提交于 2019-12-06 05:44:14
问题 I'm in the process of creating a Ubuntu Installer and I need to register my own file extension I cant find any examples of how to do this. Could people provide me with some script snippets on how to do this? NB: Im using InstallJammer to help me create the installer, which allows me to call external scripts - so that is why a script would be beneficial. 回答1: An InstallJammer installer won't integrate very well with the distribution, but here goes. Use xdg-mime install and xdg-mime default to

In Wix can an advertised shortcut use the icon from a systems file association?

泪湿孤枕 提交于 2019-12-06 02:59:09
A question is about Wix and setting the icon of an advertised shortcut: If your installer contains a manual, or document in say .pdf format and you want to create a shortcut to the PDF file. Is it possible to use an icon for the shortcut based on the systems file associations? e.g. User has Adobe reader, the shortcut gets adobe pdf icon. User has Foxit/Other reader, the shortcut gets that program icon instead. etc. As far as I understand the installer magic, this is not possible. This has nothing to do with Wix but is a general MSI behaviour. Thus you would need to use un-advertised shortcuts

How to bring up the “Windows cannot open this file” dialog?

寵の児 提交于 2019-12-06 02:42:14
问题 My users can attach documents to various entities in the application. Of course, if user A attaches a .TIFF file, user B may not have a viewer for that type of file. So I'd like to be able to bring up this dialog: alt text http://www.angryhacker.com/toys/cannotopen.png My application is C# with VS2005. Currently I do Process.Start and pass in the file name. If no association is found, it throws an exception. 回答1: This should do it: System.Diagnostics.Process p = new System.Diagnostics.Process

Is there a Windows API to modify file type associations for an extension?

非 Y 不嫁゛ 提交于 2019-12-06 01:58:57
I'm looking for a way to programatically tweak the particulars of a file association on a Windows system. For example, the "Application User to Perform this Action" setting for the "Open" action for a particular file type. Clearly I could do this by modifying the registry directly, but if there is an API I'd prefer to use that as it would likely be more resilient to changes in the OS handling of mapping extensions to applications. For my purposes I'm needing to write this in VBScript (.VBS) file because it is part of a package to be used with VMWare ThinApp that mandates it. However, I'll port

Get List of available Verbs (file association) to use with ProcessStartInfo in c#

淺唱寂寞╮ 提交于 2019-12-06 01:40:02
问题 I am trying to open and print files with the ProcessStartInfo class. (File can be anything but let`s assume it is a PDF File) ProcessStartInfo pi = new ProcessStartInfo(file); pi.Arguments = Path.GetFileName(file); pi.WorkingDirectory = Path.GetDirectoryName(file); pi.Verb = "OPEN"; Process.Start(pi); this works well for the pi.Verb = "OPEN"; . Some applications register themselves also with the verb "PRINT" but only some do. In my case (Windows PDF Viewer) I get an exception when trying to

Is it possible to launch a file's default editor from a batch file?

元气小坏坏 提交于 2019-12-05 18:33:14
Background: We can use a combination of PATHEXT and the Windows file associations to do the Command Prompt equivalent of right-clicking a file in Explorer and clicking Open , e.g.: C:\code\python> echo print "Hello, StackOverflow!" >hello.py C:\code\python> hello Hello, StackOverflow! Similarly, I could use this to launch Photoshop by typing: C:\art\source> StackOverflowLogo.PDF The Actual Problem: I need the command prompt equivalent of right-clicking the file in Explorer and selecting Edit instead. With my hello(.py) above, that would likely bring up Python's Idle editor. However, I need a

Windows: establish file association to batch file

一个人想着一个人 提交于 2019-12-05 09:32:38
I created a custom file extension I would associate to a batch script. I used ASSOC .myext=MY.FILETYPE FTYPE MY.FILETYPE=cmd /c "C:\Path\of\my\batch.bat" %1 %* by now the batch file "C:\Path\of\my\batch.bat" is a simple one-liner echo %1 And roughly works: double clicking a .myext file pops up a cmd shell echoing the file path. But a problem arises when the .myext file is in a path containing spaces: the echoed filepath is truncated to the space. Double quoting the %1 in the FTYPE statement seems not to work. FTYPE MY.FILETYPE=cmd /c "C:\Path\of\my\batch.bat" "%1" %* Double quoting %1 is

How do I pass a file as argument to my Java application created using JAR Bundler?

让人想犯罪 __ 提交于 2019-12-05 04:13:50
I would like to associate a specific file type with my application, so when I double-click one of the files of this specific type, my application opens. This works just fine, but the file I double-clicked does not get passed as an argument to my program. If I for instance associate my application with txt files and I double-click todo.txt , my application opens, but I have no idea which txt file I double-clicked. From what I can read, this is how it's supposed to work on OS X, and instead of relying on the default behaviour (how it works on e.g. Windows), I should use ApplicationListener

Mac OS X file association works, but file icon not changed

独自空忆成欢 提交于 2019-12-05 03:53:29
I have developed a Mac application using Qt 5.3.2. This application handles files with specific extension (lets say .xyz ). I have created an icon file named XYZ.icns and added it to my app bundle Resource folder ( MyApp.app/Contents/Resources/XYZ.icns ). I have also modified the bundle's Info.plist file in order to set the file association. I have added this entry: <key>CFBundleDocumentTypes</key> <array> <!-- Registered file accociation --> <dict> <key>CFBundleTypeRole</key> <string>Editor</string> <key>CFBundleTypeName</key> <string>XYZ</string> <key>CFBundleTypeExtensions</key> <array>

listen for “open file with my java application” event on windows

∥☆過路亽.° 提交于 2019-12-04 22:13:12
问题 Title is confusing, but don't know how to explain this in a few words: I have a java application that reads *.example files. I've also added a file association thanks to install4j so my application is launched when the user double clicks any file with extension *.example It seems that install4j sends the file path in the args[] so it should be easy to open that file and show it in my app. BUT what happens if the app is already running? I can only allow one instance of the application so, how