Discussion:
File Associations with Advanced Installer
V S Cordero
2016-07-20 19:32:16 UTC
Permalink
Hi all

It seems that many Xojo developers use InnoSetup for creating Windows installers.
I prefer Advanced Installer because it can create MSI packages.

One limitation I just ran into is the disabling of a ‘File Association’ wizard in the Free version.

Necessity being the mother of invention (and sleepless nights) I believe I have sorted it out manually, and also a way to mostly ‘script’ it in AI, which (currently at 12.5) accepts REGEDIT files. I am attaching a generic example in the hopes it will be useful. Tested in Windows 8.

One last-minute observation is that Xojo (at least my version) doesn’t embed the document icons from FileTypes into Windows builds; you’ll have to provide them separately. In my case, I copied a prepared .ICO file to the build’s Resources folder using Build Automation.

Cheers,

Vaughn

What follows the dashed line can be saved as a plain-text .reg file and edited or just follow my comments for the Registry changes in your AI installer.
---------
REGEDIT4

; Unique Identifier (UID)
; Create one or more UIDs for each document type
; Several file extensions may share a UID
; Set a human-friendly description as its (default) value
; BEST PRACTICE: Use reverse domain notation for UID
; RECOMMENDED: Manually set 'delete on uninstall' property on this first key (can’t be scripted)

[HKEY_CLASSES_ROOT\com.mydomain.myapp]
@="MyApp Document"

; Shell Command
; Add a shell command that can open the file, the two args must be quoted AND escaped
; ADVANCED INSTALLER: you should change this to [APPDIR]path\to\MyApp.exe after import

[HKEY_CLASSES_ROOT\com.mydomain.myapp\shell\open\command]
@=“\"path\to\MyApp.exe\" \"%1\""

; File Icons
; Optionally, declare a path to an icon resource (exe, dll, ico files)
; Append the icon's zero-based index within the file, as shown

[HKEY_CLASSES_ROOT\com.mydomain.myapp\DefaultIcon]
@="path\to\mydocumenticons.ico,0"

; File Extensions
; Associate one or more file extensions to a UID defined above
; In this example, multiple extensions share a common UID

[HKEY_CLASSES_ROOT\.myAppDoc1]
@="com.mydomain.myapp"

[HKEY_CLASSES_ROOT\.myAppDoc2]
@="com.mydomain.myapp"


_______________________________________________
Unsubscribe by sending a message to:
<nug-***@lists.xoj

Loading...