standalone File association and Inno Setup

Deploying to Windows? Utilizing VB Script execution? This is the place to ask Windows-specific questions.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
trevix
Posts: 1077
Joined: Sat Feb 24, 2007 11:25 pm
Contact:

standalone File association and Inno Setup

Post by trevix » Wed Mar 11, 2009 1:12 pm

My runrev generated application (Window XP...on Vista I've not this problem) has the right Icon and its saved documents are fine, with the right doc icon and launch the application when doubleckicked.
This ONLY if I have the application on the desktop or around it.
If instead I use Inno setup to install it, it will install fine in the program folder and start menu but the file association does no work anymore.
Even if I install with Inno Setup and lather on replace manually the app, on the program folder, with the original application, the documents don't have the right Icon and dont launch the app on double click.

1) Should I set the registry entries on Inno Setup ?
2) If so, could someone give me an easy example (I'm confused after long search on the net)
3) Inno setup registry entries talk about a "second" icon. How does this relate to RunRev
4) The Standalone setting for Windows on the RunRev docs is poorly documented: what is the Internal Name ? Does it relate to the "Value data" internal name of Inno Setup registry entries?

Thanks
Trevix

trevix
Posts: 1077
Joined: Sat Feb 24, 2007 11:25 pm
Contact:

partially resolved

Post by trevix » Wed Mar 11, 2009 3:56 pm

Not having received an answer (ok, I'm spoiled...), I tried my best, hopefully not ruining my PC...(The app name is MyApp.exe and the docs extension is .tcl)

In the [Setup] section directive on the script of Inno Setup:
ChangesAssociations=yes

then

Code: Select all

[Registry]
Root: HKCR; Subkey: ".tcl"; ValueType: string; ValueName: ""; ValueData: "MyAppDoc"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "MyAppDoc"; ValueType: string; ValueName: ""; ValueData: "MyApp document"; Flags: uninsdeletekey
Root: HKCR; Subkey: "MyAppDoc\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\MyApp.EXE,1"
Root: HKCR; Subkey: "MyAppDoc\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\MyApp.EXE"" ""%1"""
Now everything seems to work.
Did I do everything correctly (I know nothing about registy...) ?

Garrett
Posts: 386
Joined: Sat Apr 08, 2006 8:15 am
Contact:

Post by Garrett » Wed Mar 11, 2009 6:03 pm

You have the file extension entry in the root, you have it's reference, you have the reference in the root, it's defaulticon and you have the shell command pointing to your app and a valid value for it too. So your actual registry data looks good.

The Inno script looks correct too.
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)

trevix
Posts: 1077
Joined: Sat Feb 24, 2007 11:25 pm
Contact:

Post by trevix » Thu Mar 12, 2009 12:36 am

OH,OH...
Everything install correctly on a Admin account...but when I switch to a different account, the association is lost: no doc Icon and no doubleclick on the doc.

Any help ?

Garrett
Posts: 386
Joined: Sat Apr 08, 2006 8:15 am
Contact:

Post by Garrett » Thu Mar 12, 2009 6:28 am

Hmmm, did you set for local user only, or all users?
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)

Garrett
Posts: 386
Joined: Sat Apr 08, 2006 8:15 am
Contact:

Post by Garrett » Thu Mar 12, 2009 6:30 am

Hmmm... I'm not sure what happened. Too tired to think now too.
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)

shadowslash
Posts: 344
Joined: Tue Feb 24, 2009 6:14 pm
Contact:

Post by shadowslash » Thu Mar 12, 2009 3:12 pm

file associations can only be set by an administrator account.. not unless you specify the permissions in the registry editor... you can set non-admin users to modify the registry keys under HKEY_CLASSES_ROOT... Image
Parañaque, Philippines
Image
Image

trevix
Posts: 1077
Joined: Sat Feb 24, 2007 11:25 pm
Contact:

Post by trevix » Thu Mar 12, 2009 4:35 pm

I understand that I have to modify the Inno script, but can you be more specific ?
I want the user to install the program only under Admin account (done: privilegesRequired=admin on the [setup]). But of course I need file associated on all account, after the install under admin account.

This is my actual registry script:

Code: Select all

[Registry]
Root: HKCR; Subkey: ".tcl"; ValueType: string; ValueName: ""; ValueData: "TcalDoc"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "TcalDoc"; ValueType: string; ValueName: ""; ValueData: "Tcal document"; Flags: uninsdeletekey
Root: HKCR; Subkey: "TcalDoc\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\Tcal.EXE,1"
Root: HKCR; Subkey: "TcalDoc\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\Tcal.EXE"" ""%1"""

shadowslash
Posts: 344
Joined: Tue Feb 24, 2009 6:14 pm
Contact:

Post by shadowslash » Thu Mar 12, 2009 4:41 pm

i'm assuming you're using Windows XP? this has been a common problem for Win XP.. even other programs that associates with an extension has this problem.. the only way (at least, the only way that i know of) is to temporarily change the non-admin account to an admin account for the mean time and install your program through that account... Image
Parañaque, Philippines
Image
Image

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Thu Mar 12, 2009 5:14 pm

Hi,

I haven't read the whole thread, but probably you want something like

User: HKCR; Subkey:

instead of

Root: HKCR; Subkey:

I know what it looks like in the registry, I don't know what it looks like in InnoSetup.

I have no problems when setting associating file extensions on a user rather than admin account. The user just needs to allow it and you need to make sure that you're changing the user account only.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Garrett
Posts: 386
Joined: Sat Apr 08, 2006 8:15 am
Contact:

Post by Garrett » Thu Mar 12, 2009 7:25 pm

He's using the ROOT instead of USER in his Inno script up there. But it seems he can't get it working for "all users". It's beyond my scope of Inno because I've only used Inno for current user installs and not all users.

You might consider hitting the forums for Inno. I'm sure someone there will have the solution for you. :-)

Hmmm, seems they have either a mailing list, or some newsgroups to choose from. You'll have to decide which.
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)

trevix
Posts: 1077
Joined: Sat Feb 24, 2007 11:25 pm
Contact:

Post by trevix » Fri Mar 13, 2009 1:21 am

You got the point. When you install for example Office on a PC, you may be asked to log as administrator, but one installed, file association is correct on all user account.
Inno Setup installer by the way, does this: once installed, his script are correctely associated on different login. So there must be a way...

I'm doing intensive search, but nothin yet. Strange, since it is correctely suggested, for security reason, not to use an admin login for everyday use.
So this problem should concern ALL application developers...

Post Reply