Page 1 of 1
standalone File association and Inno Setup
Posted: Wed Mar 11, 2009 1:12 pm
by trevix
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
partially resolved
Posted: Wed Mar 11, 2009 3:56 pm
by trevix
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...) ?
Posted: Wed Mar 11, 2009 6:03 pm
by Garrett
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.
Posted: Thu Mar 12, 2009 12:36 am
by trevix
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 ?
Posted: Thu Mar 12, 2009 6:28 am
by Garrett
Hmmm, did you set for local user only, or all users?
Posted: Thu Mar 12, 2009 6:30 am
by Garrett
Hmmm... I'm not sure what happened. Too tired to think now too.
Posted: Thu Mar 12, 2009 3:12 pm
by shadowslash
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...

Posted: Thu Mar 12, 2009 4:35 pm
by trevix
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"""
Posted: Thu Mar 12, 2009 4:41 pm
by shadowslash
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...

Posted: Thu Mar 12, 2009 5:14 pm
by Mark
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
Posted: Thu Mar 12, 2009 7:25 pm
by Garrett
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.
Posted: Fri Mar 13, 2009 1:21 am
by trevix
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...