0
votes

I'm looking at moving away from using ClickOnce to deploy my .net app. Presently I am using InnoSetup as a wrapper so I can distribute a single executable to users. This has worked fine for our first release - ClickOnce handles the File Associations and ensuring that the correct .net framework is installed - which is nice.

However now we are looking at releasing an update and found that our new version installs along-side the old (and the old version retains the file associations). If the old version is uninstalled first then everything works fine, however, at present this process is a manual one (user has to go into Control Panel and uninstall it). I already have a question here relating to this problem but since no answers have been forthcoming, I'm looking to see if I get InnoSetup to handle everything (including the uninstall).

I've already found examples that should help me replicate the .net framework check and install with InnoSetup. Now I just need something that shows me explicitly how to create the file association entries that ClickOnce creates. Can anyone point me in the right direction here?

EDIT : I know that InnoSetup can create/edit registry entries (there are multiple questions on here relating to that), I'd like to know specifically which ones I need to create and where.

1

1 Answers

1
votes

This turned out to be a bit of a no brainer. The InnoSetup documentation here describes the process and it is relatively painless. I was under the impression that ClickOnce went off and did some other 'magic' but it would appear that's not the case.

[Setup]
ChangesAssociations=yes

[Registry]
Root: HKCR; Subkey: ".myextension"; ValueType: string; ValueName: ""; ValueData: "MyProgName"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "MyProgName"; ValueType: string; ValueName: ""; ValueData: "File Type Description"; Flags: uninsdeletekey
Root: HKCR; Subkey: "MyProgName\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\MyProgName.exe,0"
Root: HKCR; Subkey: "MyProgName\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\MyProgName.exe"" ""%1""" 

My new version overwrites these entries when it is installed and everything works perfectly.