Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • December 05, 2016, 09:02:40 PM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Need Inno Setup Advice  (Read 3642 times)

kyrathaba

  • N.A.N.Y. Organizer
  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 3,120
    • View Profile
    • Donate to Member
Need Inno Setup Advice
« on: January 18, 2007, 08:18:46 PM »
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.

Quote
; 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"""


tinjaw

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,927
    • View Profile
    • Donate to Member
Re: Need Inno Setup Advice
« Reply #1 on: January 18, 2007, 08:43:26 PM »
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

  • N.A.N.Y. Organizer
  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 3,120
    • View Profile
    • Donate to Member
Re: Need Inno Setup Advice
« Reply #2 on: January 18, 2007, 09:24:04 PM »
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

  • N.A.N.Y. Organizer
  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 3,120
    • View Profile
    • Donate to Member
Re: Need Inno Setup Advice
« Reply #3 on: January 18, 2007, 09:26:52 PM »
Correction:

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

Quote
[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

Anyway, it works the way I want :)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,406
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Need Inno Setup Advice
« Reply #4 on: January 18, 2007, 10:32:38 PM »
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:

kyrathaba

  • N.A.N.Y. Organizer
  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 3,120
    • View Profile
    • Donate to Member
Re: Need Inno Setup Advice
« Reply #5 on: January 18, 2007, 10:53:43 PM »
Since you're noting it for possible later reference, Mouser, I'll make a correction to what I posted.  The registry section winds up looking like this:

Quote
[Registry]
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

Apparently, if you omit the entry involving DefaultIcon for whatever particular file you are intending to associate with your app, then that filetype receives the app's icon.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,406
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Need Inno Setup Advice
« Reply #6 on: January 18, 2007, 11:00:53 PM »
I've actually learned a little from your script - even though i've been using Inno for a couple years i've never used #defines and some of the variables - that would definitely make my scripts easier to reuse, thanks.  :up: