topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • July 21, 2018, 03:10 AM
  • Proudly celebrating 13 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 4777 times)

kyrathaba

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

; 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 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,145
    • View Profile
    • Donate to Member
Re: Need Inno Setup Advice
« Reply #2 on: January 18, 2007, 09:24 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,145
    • View Profile
    • Donate to Member
Re: Need Inno Setup Advice
« Reply #3 on: January 18, 2007, 09:26 PM »
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

Anyway, it works the way I want :)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 38,723
    • 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 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,145
    • View Profile
    • Donate to Member
Re: Need Inno Setup Advice
« Reply #5 on: January 18, 2007, 10:53 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:

[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: 38,723
    • 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 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:

OptimalDesigns

  • Supporting Member
  • Joined in 2018
  • **
  • Posts: 17
  • retired applied mathematician
    • View Profile
    • Calculus-level Problem Solving, Examples & Compiler
    • Read more about this member.
    • Donate to Member
Re: Need Inno Setup Advice
« Reply #7 on: June 21, 2018, 09:42 AM »
Seeking help to add a script to Inno Setup Compiler that will 'copy' my shortcut 'files' or links to each user installing my app.  The following ISS code is what I tried.

[Files]
; old way to execute my abc.exe routine.
Source: "...\abc.exe"; DestDir: "{app}\.."; Flags: sharedfile uninsneveruninstall ignoreversion

; next line is a NoGo ... Inno Setup Compiler says '...-launch' are not files!
Source: "...\abc-launch"; DestDir: "{app}\.."; Flags: sharedfile uninsneveruninstall ignoreversion
-----------

I have several apps that run in DOSbox, a Window's app that runs 16-bit DOS.  The font size and colors of text & background are my problems.  In order to fix these problems, shortcut's are created in Windows OS (within Windows Explorer) and are renamed "...-launch".  Several batch files execute these '-launch' shortcuts with the 'start' cmd; e.g.  start "%FCapp%'s DOSbox Setup" /wait abc.exe /openLF %FCname% ... parameters 4 input
This starts my abc.exe routine with the 'normal' small font size and a black background.  This is hard for me to see.

Next, these '-launch' shortcuts were created that fix the font size and background color.  This will allow each user that downloads my app to set their own size and colors.  Now, my batch files execute these abc.exe files with a '...-launch' shortcut.  These '...-launch' shortcuts are then executed in a batch file with a ...  start "%FCapp%'s DOSbox Setup" /wait abc-launch /openLF %FCname% ... parameters 4 input .

This method provides a nice solution ... font size & background color are good.  Plus, a user may change these settings if they would like too.

These '...-launch' shortcuts must -not- be deleted by user.  But, 4 apps have some duplicate shortcuts so updates must be able to over-write or replace them.  These shortcuts all have one or more parameters that must be passed to them.  'Pin' to desktop should be prohibited.

Ideas on how to create a script in Inno Setup to copy these '...-launch' shortcuts to every one of my apps and be installed to user that downloads one or more of my apps and installs it or them?

Thanks, Phil

KodeZwerg

  • Member
  • Joined in 2018
  • **
  • Posts: 89
    • View Profile
    • Donate to Member
Re: Need Inno Setup Advice
« Reply #8 on: June 21, 2018, 10:03 AM »
Inno Script Studio might worth a try too.

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,191
    • View Profile
    • Donate to Member
Re: Need Inno Setup Advice
« Reply #9 on: June 21, 2018, 02:05 PM »
Seeking help to add a script to Inno Setup Compiler that will 'copy' my shortcut 'files' or links to each user installing my app.
-OptimalDesigns (June 21, 2018, 09:42 AM)
Reading the manual of Inno Setup (here) is sure going to help you a lot.
Those shortcut/link files are a) system specific (they usually have absolute paths embedded), and b) are actually files with a .lnk extension, that Windows really, really hides from anyone trying to make the extension visible. For those reasons it is quite hard to copy them from system to system, unless you can guarantee the files are in the same location.
Inno has a specific section just for creating those shortcuts, though I'm not sure if you can set the font and color of the application, I just haven't tried (or needed) that in ~18 years of using Inno Setup...

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 38,723
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Need Inno Setup Advice
« Reply #10 on: June 21, 2018, 07:28 PM »
It sounds like what ATH is saying is your problem -- that the source shortcut files you are referring to as "...\abc-launch" are really named "...\abc-launch.lnk" and you just aren't seeing the .lnk extension in your windows file explorer which is causing you to think they are named differently than they really are, causing inno to not find them.  Does that sound plausible?

OptimalDesigns

  • Supporting Member
  • Joined in 2018
  • **
  • Posts: 17
  • retired applied mathematician
    • View Profile
    • Calculus-level Problem Solving, Examples & Compiler
    • Read more about this member.
    • Donate to Member
Re: Need Inno Setup Advice
« Reply #11 on: June 22, 2018, 03:48 PM »
Inno Script Studio might worth a try too.

They seem to be out of town or deceased.  :(

I tried the following but nogo.  How does one copy a shortcut (.LNK ir file) with Inno Setup?

This 'icon' thing seems wrong, since its -not- an icon copy that is giving me problems.

#define MyAppName "Robot4"
AppName={#MyAppName}
DefaultGroupName={#MyAppName}

[Icons]
Name: "{group}\..\base4apps-exe-launch"; Filename: "{app}\.."

Ideas?

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 38,723
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Need Inno Setup Advice
« Reply #12 on: June 22, 2018, 03:51 PM »
How does one copy a shortcut (.LNK ir file) with Inno Setup?
It's just a regular file so you do everything with it as you would a normal file -- that's why a couple of us are suspecting that you are just not providing the full file name -- perhaps because it's not showing it to you in your windows explorer when you look at it.

Are you using Inno Studio or one of the modern GUI front ends for Inno Setup? They really can make life easier.

OptimalDesigns

  • Supporting Member
  • Joined in 2018
  • **
  • Posts: 17
  • retired applied mathematician
    • View Profile
    • Calculus-level Problem Solving, Examples & Compiler
    • Read more about this member.
    • Donate to Member
Re: Need Inno Setup Advice
« Reply #13 on: June 22, 2018, 04:19 PM »
source shortcut files you are referring to as "...\abc-launch" are really named "...\abc-launch.lnk" and you just aren't seeing the .lnk extension in your windows file explorer ... Does that sound plausible?

Yes, that was my problem ... many thanks. :)

Phil

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 38,723
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Need Inno Setup Advice
« Reply #14 on: June 22, 2018, 04:35 PM »
 :Thmbsup: