Reputation: 11
What is the "All Users" constant? I would need to create some shortcuts in this directory: "C:\Users\All Users\Microsoft\Windows\GameExplorer"
Could someone help me?
Upvotes: 1
Views: 4547
Reputation: 10516
[Tasks]
Name: "Myicon"; Description: "Create an icon in Games explorer"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Icons]
Name: "{%ABCDEFA|C:\Users\All Users\Microsoft\Windows\GameExplorer}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" ; Tasks:Myicon
Add these lines to your script.this will create icon in "C:\Users\All Users\Microsoft\Windows\GameExplorer" place .. you can create icons where ever you want.
This can be done with the help of one of the other Constants of inno setup
{%NAME|DefaultValue} Embeds the value of an environment variable.
•NAME specifies the name of the environment variable to use.
•DefaultValue determines the string to embed if the specified variable does not exist on the user's system. •If you wish to include a comma, vertical bar ("|"), or closing brace ("}") inside the constant, you must escape it via "%-encoding." Replace the character with a "%" character, followed by its two-digit hex code. A comma is "%2c", a vertical bar is "%7c", and a closing brace is "%7d". If you want to include an actual "%" character, use "%25".
•NAME and DefaultValue may include constants. Note that you do not need to escape the closing brace of a constant as described above; that is only necessary when the closing brace is used elsewhere.
Examples:
{%COMSPEC}
{%PROMPT|$P$G}
if want you can use this simple test script.I was tested this and working fine for me.
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "My Program"
#define MyAppVersion "1.5"
#define MyAppPublisher "My Company, Inc."
#define MyAppURL "http://www.example.com/"
#define MyAppExeName "MyProg.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={{E17175FC-0DF4-4B56-B50D-40D83EA8E19E}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "Myicon"; Description: "Create an icon in Games explorer"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "C:\Program Files (x86)\Inno Setup 5\Examples\MyProg.exe"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{%ABCDEFA|C:\Users\All Users\Microsoft\Windows\GameExplorer}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" ; Tasks:Myicon
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
Upvotes: 2
Reputation: 13030
You are supposed to use the appropriate API calls to do that. See the Using DLLs help topic to see how to call APIs from within Inno's [Code]
.
Upvotes: 2