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

Other Software > Developer's Corner

Help with Inno Setup shortcuts please!

(1/2) > >>

wreckedcarzz:
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:
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:
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:
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.

--- End quote ---

Hopefully this helps someone else out as well :)

tinjaw:
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.

Navigation

[0] Message Index

[#] Next page

Go to full version