Indigo Rose Software
  #1  
Old 04-28-2008
Adam's Avatar
Adam Adam is offline
Indigo Rose Staff Member
 
Join Date: May 2000
Location: Indigo Rose Software
Posts: 2,154
Create file association

Question:
Can I create a file association using actions in Setup Factory 7.0?

Answer:
Yes you can create a file association in the following IndigoRose titles:

And here is how:

In order to set up a file association we will need to use two set Registry value actions and an optional third set Registry value action.

Example

This example creates a file association between the file extension *.KQX and the program %AppFolder%\\MyProgram.exe.

The first Modify Registry action will link the *.KQX file extension with "KQXEditor" which is another registry key:

Registry Action: Set Value
Main Key: HKEY_CLASSES_ROOT
Sub Key: .KQX
Value:
Data: KQXEditor
Type: REG_SZ

Example:
Registry.SetValue(HKEY_CLASSES_ROOT, ".KQX", "", "KQXEditor", REG_SZ);

The "KQXEditor" registry key will tell the operating system what to do with files that have the *.KQX extension. We will tell the operating system to open all files, with the *.KQX extension, with %AppFolder%\\MyProgram.exe. The next Modify Registry action will create the KQXEditor registry key:

Registry Action: Set Value
Main Key: HKEY_CLASSES_ROOT
Sub Key: KQXEditor\\shell\\open\\command
Value:
Data: %AppFolder%\\MyProgram.exe "%1"
Type: REG_SZ

Example:
Registry.SetValue(HKEY_CLASSES_ROOT, "KQXEditor\\\\shell\\\\open\\\\command", "", SessionVar.Expand("%AppFolder%\\\\MyProgram.exe \\"%1\\"") , REG_SZ);

The third (and optional) step is to associate an icon with files using the *.KQX file extension. We will set the icon for all KQX files to be the same icon that our KQXEditor (%AppFolder%\\MyProgram.exe) uses:

Registry Action: Set Value
Main Key: HKEY_CLASSES_ROOT
Sub Key: KQXEditor\\DefaultIcon
Value:
Data: %AppFolder%\\MyProgram.exe,0
Value Type: REG_SZ

Example:
Registry.SetValue(HKEY_CLASSES_ROOT, "KQXEditor\\\\DefaultIcon", "", SessionVar.Expand("%AppFolder%\\\\MyProgram.exe ,0\\")", REG_SZ);
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create a log file that gets all Installation info MathiasvK AutoPlay Media Studio 7.5 Discussion 1 04-01-2008 07:16 AM
HELP: Trying to create a bookmark for audio Ren AutoPlay Media Studio 5.0 3 09-12-2005 06:20 AM
Help: Trying to create a bookmark for audio Ren AutoPlay Media Studio 5.0 0 09-09-2005 02:43 PM
Create a blank file on users system kpsmith AutoPlay Media Studio 4.0 3 11-08-2002 09:32 AM
HOWTO: Create a File Association Support Setup Factory 6.0 Knowledge Base 0 10-04-2002 03:37 PM


All times are GMT -6. The time now is 03:11 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software