It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
Ok, I have been making installers in InnoSetup for a while now, but the problem I am having now is, when a programs directroy is like "C:/Games/TestGame", but the main executable is "C:/Games/TestGame/bin/game.exe", how do I make my installer link to that WITHOUT moving the exe? when I make game.exe the main executable, it puts it in the root directory and makes a shortcut of that, but I want it to stay were it is and be shortcutted.

How can I do this?
This question / problem has been solved by carlosjueroimage
I haven't used InnoSetup in quite a while, but there should be an option to do that either via the installer creation menus, or via scripting [I am guessing via scripting as you seem to be having issues w/ the wizard]

Just going by the basic examples shown here: http://www.jrsoftware.org/ishelp/index.php?topic=iconssection

You would change the install script for the shortcut in the [Icons] optional section:

eg: something like:

[Icons]
Name: "{commondesktop}\My Program"; Filename: "{app}\bin\MYPROG.EXE"; WorkingDir: "{app}"

Notice the bolded part - you need to specify the /bin folder.
Well, not sure I understand what your trying to tell me, but I make the installer using just the wizard, and if I click 'Make the program have a main executable' then it makes a shortcut to that main executable, but if I browse to game/bin/game.exe, it moves game.exe to game.

Here is my code if it makes it any easier

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

#define MyAppName "Game"
#define MyAppVersion "1.0"
#define MyAppPublisher "Publisher"
#define MyAppExeName "game.exe"

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{*********-****-****-****-************}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
InfoAfterFile=C:\Documents and Settings\user\Desktop\game\Docs\ReadMe.txt
OutputDir=C:\Documents and Settings\user\Desktop\game
OutputBaseFilename=setup
SetupIconFile=C:\Documents and Settings\user\My Documents\Downloads\System-Install-2.ico
Compression=lzma2
SolidCompression=yes
DiskSpanning=yes
DiskSliceSize=536870912

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

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

[Files]
Source: "C:\Documents and Settings\user\Desktop\game\Bin\game.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Documents and Settings\user\Desktop\game\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

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

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

So now what do I need to do?
The wizard should have added more to the script file. I downloaded InnoSetup and created a quick test script. Are you using the most recent version of InnoSetup ?[5.4.3]

If InnoSetup is moving files around on you then the first thing you have to do is move the file back to where you need it after creating the script.

Then in your script file change:

[Files]
Source: "C:\Program Files (x86)\Inno Setup 5\Examples\MyProg.exe"; DestDir: "{app}"; Flags: ignoreversion

modify the DestDir directive to read DestDir: "{app}\bin

Further down in the [Icons] section you need to add/modify the two lines:

Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

- change the FileName directives to read {app}\bin\{#MyAppExeName}

If you are using an older version of InnoSetup I would suggest downloading the newest version [it is free after all] and installing it. Make sure to install the official addon that comes with it [pre-compilation helps].
avatar
carlosjuero: The wizard should have added more to the script file. I downloaded InnoSetup and created a quick test script. Are you using the most recent version of InnoSetup ?[5.4.3]

If InnoSetup is moving files around on you then the first thing you have to do is move the file back to where you need it after creating the script.

Then in your script file change:

[Files]
Source: "C:\Program Files (x86)\Inno Setup 5\Examples\MyProg.exe"; DestDir: "{app}"; Flags: ignoreversion

modify the DestDir directive to read DestDir: "{app}\bin

Further down in the [Icons] section you need to add/modify the two lines:

Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

- change the FileName directives to read {app}\bin\{#MyAppExeName}

If you are using an older version of InnoSetup I would suggest downloading the newest version [it is free after all] and installing it. Make sure to install the official addon that comes with it [pre-compilation helps].
Thanks dude - that worked flawlessly (and btw I am version 5.4.3)

One other thing - in Innosetup can you make it add custom values to the registry, but those values depend upon your install directory?
avatar
carlosjuero: snip
Oh and one other thing, can I make it so in the Add and Remove programs not have 'version ?.?? so it is only like "Game' instead of "Game version 1.1"?