ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Other Software > Developer's Corner

Need Inno Setup Advice

(1/3) > >>

kyrathaba:
I have a relatively short Inno Setup script that isn't quite working the way I want it to work.  For the most part, it works perfectly:  it installs the program where it's told to do so, it creates an uninstall that works well, creates a website URL shortcut that works correctly...

The only thing I'm apparently messing up on is in the [Registry] section.  I'm trying to create an association between the application's proprietary resource files (*.crf) and the application, so that double-clicking on a file created by the program in a previous session will launch the app and open the file.  Instead, what happens is that the file opens when you double-click, but in Notepad :( 

Oh, and I think I'm also doing something wrong when it comes to specifying the icon I want associated with these *.crf files.  Any help at all would be greatly appreciated.  I'm attaching the .zip of the entire project, including the setup script and the setup.exe that Inno Setup produced.

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Crocus Contacts"
#define MyAppVerName "Crocus Contacts 1.1"
#define MyAppPublisher "Crocus Donationware"
#define MyAppURL "http://www1.webng.com/bowrsanryld/"
#define MyAppExeName "lovebook.exe"

[Setup]
AppName={#MyAppName}
AppVerName={#MyAppVerName}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
ChangesAssociations=yes
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
LicenseFile=C:\Documents and Settings\Owner\My Documents\Visual Studio Projects\lovebook\bin\Release\license.txt
InfoBeforeFile=C:\Documents and Settings\Owner\My Documents\Visual Studio Projects\lovebook\bin\Release\before_install.txt
InfoAfterFile=C:\Documents and Settings\Owner\My Documents\Visual Studio Projects\lovebook\bin\Release\after_install.txt
OutputDir=C:\Documents and Settings\Owner\My Documents\Visual Studio Projects\lovebook\setup output
OutputBaseFilename=cc_setup
SetupIconFile=C:\Documents and Settings\Owner\My Documents\Visual Studio Projects\lovebook\person.ico
Compression=lzma
SolidCompression=yes

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Files]
Source: "C:\Documents and Settings\Owner\My Documents\Visual Studio Projects\lovebook\bin\Release\lovebook.exe"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#MyAppName}}"; Flags: nowait postinstall skipifsilent

[Registry]
Root: HKCR; Subkey: ".crf"; ValueType: string; ValueName: ""; ValueData: "crocuscontactsresfile"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "Crocus Contacts Resource File"; ValueType: string; ValueName: ""; ValueData: "Crocus Contacts Resource File"; Flags: uninsdeletekey
Root: HKCR; Subkey: "Crocus Contacts\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\lovebook.exe,0"
Root: HKCR; Subkey: "Crocus Contacts\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\lovebook.exe"" ""%1"""


--- End quote ---

tinjaw:
I don't have Inno installed, nor have I ever used it, but let me make some guesses.


--- ---Root: HKCR; Subkey: ".crf"; ValueType: string; ValueName: ""; ValueData: "crocuscontactsresfile"; Flags: uninsdeletevalue
since you use "crocuscontactsresfile", my guess is that the Subkey in the next one should be the same, "crocuscontactsresfile".


--- ---Root: HKCR; Subkey: "Crocus Contacts Resource File"; ValueType: string; ValueName: ""; ValueData: "Crocus Contacts Resource File"; Flags: uninsdeletekey

kyrathaba:
I've been fiddling with it for half-an-hour.  Wound up just removing the 3rd of the 4 lines under the [Registry] section, and all is working as desired.  There is double-click functionality, and the "contact files" have the same icon as the main app :>  Thanks.

kyrathaba:
Correction:

I was using ISTool by istool.org and this is what the final [Registry] section looked like:

[Registry]
Root: HKCR; Subkey: .crf; ValueType: string; ValueName: ; ValueData: crocuscontactsresfile; Flags: uninsdeletevalue
Root: HKCR; Subkey: Crocus Contacts Resource File; ValueType: string; ValueName: ; ValueData: Crocus Contacts Resource File; Flags: uninsdeletekey
Root: HKCR; Subkey: Crocus Contacts\DefaultIcon; ValueType: string; ValueName: ; ValueData: {app}\lovebook.exe,0
Root: HKCR; Subkey: Crocus Contacts\shell\open\command; ValueType: string; ValueName: ; ValueData: """{app}\lovebook.exe"" ""%1"""


Root: HKCR; SubKey: .crf; ValueType: string; ValueData: ccresfile; Flags: uninsdeletekey
Root: HKCR; SubKey: ccresfile; ValueType: string; ValueData: Crocus Contacts Resource File; Flags: uninsdeletekey
Root: HKCR; SubKey: ccresfile\Shell\Open\Command; ValueType: string; ValueData: """{app}\lovebook.exe"" ""%1"""; Flags: uninsdeletevalue
--- End quote ---

Anyway, it works the way I want :)

mouser:
I use inno in my projects but i've never used this feature - so thanks for figuring it out - i'll bookmark this in case i need it  :up:

Navigation

[0] Message Index

[#] Next page

Go to full version