topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • Thursday March 28, 2024, 10:06 am
  • Proudly celebrating 15+ 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: Help with Inno Setup shortcuts please!  (Read 23595 times)

wreckedcarzz

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 1,626
    • View Profile
    • Donate to Member
Help with Inno Setup shortcuts please!
« on: March 19, 2008, 04:57 PM »
Sorry about the strange topic title, but it was a bit too long IMO. If anyone can, could someone please instruct me as to how to create a shortcut in the Start Menu (I have accomplished this part) with a "Start In" directory? I need to do this to run other EXE files in that directory, and they fail to open without this entered.

Here is my code that I have for icon creation in the Start Menu, on the desktop, and in the Quick Launch bar.

[Icons]
Name: "{group}\SnapSuite 2008"; Filename: "{app}\SnapSuite 2008.exe"
Name: "{group}\{cm:UninstallProgram,SnapSuite 2008}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\SnapSuite 2008"; Filename: "{app}\SnapSuite 2008.exe"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\SnapSuite 2008"; Filename: "{app}\SnapSuite 2008.exe"; Tasks: quicklaunchicon

Can someone help me with this? I am sure it is simple but I do not want to make any errors. :)

-Brandon

Veign

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 993
    • View Profile
    • Veign - Where design meets development
    • Donate to Member
Re: Help with Inno Setup shortcuts please!
« Reply #1 on: March 19, 2008, 05:29 PM »
Set a default groupname in the [setup] section like:
DefaultGroupName=MyCompany\MyApplication

Then in the [icons] section place:
Name: {group}\MyApplication; Filename: {app}\MyApp.exe
Name: {group}\Help; Filename: {app}\MyHelp.chm
Name: {group}\Uninstall; Filename: {uninstallexe}

Also, you should be asking the user if they want the icons placed on the desktop and quicklaunch bar and not do it by default.  Give the user the option.

wreckedcarzz

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 1,626
    • View Profile
    • Donate to Member
Re: Help with Inno Setup shortcuts please!
« Reply #2 on: March 19, 2008, 06:06 PM »
I have the DefaultGroupName, and it creates only the Start Menu folder by default - the other two are checkbox options, but I need the "Start In" box data with those as well :)

I still don't understand how to add the start in directory? :huh:

wreckedcarzz

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 1,626
    • View Profile
    • Donate to Member
Re: Help with Inno Setup shortcuts please!
« Reply #3 on: March 19, 2008, 06:08 PM »
Never mind, I just found this at the Inno Setup FAQ...

Q: My application can't find any of its files when it is started from the shortcut created by Setup. It works fine when I double-click the application's EXE in Explorer.

    A: Your application is most likely not specifying pathnames on the files it is trying to open, so it is expecting to find them in the current directory. Inno Setup by default does not set the "Start In" field on shortcuts its creates; this causes Windows to pick a directory itself, which usually won't be the directory containing your application.

    In virtually all cases, this is something that should be corrected at the application level. Properly designed GUI applications should not expect to be started from a particular directory; they should always specify full pathnames on files they open. In Delphi or C++Builder, for example, it's possible to get the full pathname of the directory containing the application EXE by calling: ExtractFilePath(ParamStr(0)). To get the full path of a file named "File.txt" in the application directory, use: ExtractFilePath(ParamStr(0)) + 'File.txt'.

    If for some reason you cannot fix this at the application level, you can tell Inno Setup to set the "Start In" field by adding "WorkingDir: {app}" to your [Icons] entries.

Hopefully this helps someone else out as well :)

tinjaw

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,927
    • View Profile
    • Donate to Member
Re: Help with Inno Setup shortcuts please!
« Reply #4 on: March 19, 2008, 07:43 PM »
Brandon,

I want to praise you young Jedi. You have done well.

  • You asked for help only after you tried it yourself.
  • You didn't stop trying yourself after you asked for help.
  • When your hard work paid off, you didn't just stop there. You thought about your brother developers and returned to post a solution.

I commend you sir.

I have also sent you some credits for leading my example. They may come in handy if you hit some tougher problem and get help from a mentor. You can then show your appreciation for their help.

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,612
    • View Profile
    • Donate to Member
Re: Help with Inno Setup shortcuts please!
« Reply #5 on: April 19, 2008, 11:43 AM »
A simple RTFM should have fixed this, before the question would have been posted here...  :-[

HTH
Ath
(Yes, long time InnoSetup user...)

wreckedcarzz

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 1,626
    • View Profile
    • Donate to Member
Re: Help with Inno Setup shortcuts please!
« Reply #6 on: April 21, 2008, 10:44 PM »
I find that the FAQ and/or WIKIs for most programs aren't that clear (or even available) and everyone here at DC is quite knowledgeable. So I tend to do a quick scan over the website and Google, post here, and then continue looking. Even if I find an answer, someone from DC might have a better solution. You never know.