InnoSetup setting up desktop shortcut for node-webkit apps - node.js

I am setting up an installer for node-webkit desktop app. I have successfully created an app shortcut but I can't create a desktop shortcut because it requires an exe file. I am passing working directory reference to nw.exe in shortcut it works fine but there seems no option for creating a custom desktop icon. Here is my inno setup config file:
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}/node-webkit/nw.exe" ; Parameters: "."; WorkingDir: "{app}"; IconFilename: "{app}\{#MyAppIcon}"
Following code creates a desktop shortcut. Is there any way I can pass above icon reference to desktop icon?
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}";

Here is the answer if anyone is looking for a solution. Thanks TLama.
[Icons]
Name: "{commondesktop}\{#MyAppName}"; Filename: "your.exe" ; Parameters: "."; WorkingDir: "{app}"; IconFilename: "{app}\{#MyAppIcon}"; Tasks: desktopicon
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}";

Related

Inno Setup: Disable desktop icon and autostart entry via command line parameter

I'm creating an desktop icon and an autostart entry with an Inno Setup script like this:
[Icons]
Name: "{commonstartup}\abc"; Filename: "{app}\xyz.exe"; WorkingDir: "{app}"; Flags: createonlyiffileexists; Tasks: StartMenuEntry
Name: "{commondesktop}\abc"; Filename: "{app}\xyz.exe"; WorkingDir: "{app}"; IconIndex: 0; Tasks: desktopicon
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"
Name: "StartMenuEntry"; Description: "{cm:AutoStartProgram}"; GroupDescription: "{cm:AutoStartProgramGroupDescription}"
Some users want to run my setup.exe from the command line. They want to add a parameter for silent installation /VERYSILENT and a parameter for disabling the desktop icon and the autostart entry.
Is that possible with a command line parameter? If not: What else is possible to do that? Thanks!
Use /TASKS or better /MERGETASKS command-line switches to alter the default task selection.
Particularly, to disable particular task, use /MERGETASK=!taskname:
mysetup.exe /VERYSILENT /MERGETASKS=!desktopicon,!StartMenuEntry
Related question: Command line switch to prevent Inno Setup installer from creating desktop Icon

Inno Setup: Rename existing shortcut

I need to change the name of desktop application shortcut when I publish the next release of the application. I am updating my Inno Setup configuration file and I generated a new shortcut with the new name but the old shortcut is not updated or deleted.
Can I use some task or function to do it?
This my current configuration for shortcut icon.
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; \
GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
...
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
Use [InstallDelete] section entry to delete the unwanted/old shortcut/file:
[Icons]
Name: "{commondesktop}\New Shortcut"; Filename: "{app}\{#MyAppExeName}"; \
Tasks: desktopicon
[InstallDelete]
Type: files; Name: "{commondesktop}\Old Shortcut.lnk"

Add desktop icon only if not running silently

Is it possible to only apply this task if setup is not running silently. I've already tried adding the flags attribute, but is not applicable to anything other than RUN directive.
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}";
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}";
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon;
Use the Check parameter with the WizardSilent function.
[Tasks]
Name: "desktopicon"; ... ; Check: not WizardSilent

Inno Setup always creates desktop icon

When I run my Inno Setup script, it always creates a desktop icon regardless of whether I check the "Create a desktop icon" or not.
Here is the applicable part of the script:
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"
[Icons]
Name: "{group}\{#MyAppName} "; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{#MyAppName} Users Guide"; Filename: "{pf32}\Ishmael\Ishmael 2.5\Ishmael 1.0 Users Guide.pdf";
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{pf32}\Ishmael\Ishmael 2.5\bin\SpermBlow.ico"
Thanks,
Curtis
This entry in unconditional:
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{pf32}\Ishmael\Ishmael 2.5\bin\SpermBlow.ico"
So it indeed always creates the icon, no matter if you check the "Create a desktop icon" or not. It's missing Tasks: desktopicon condition.
I'm not sure what you wanted to achieve by the two entries with the same name.
Maybe you just need to combine them to one:
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; \
IconFilename: "{pf32}\Ishmael\Ishmael 2.5\bin\SpermBlow.ico"; Tasks: desktopicon
The above will create the icon conditionally, based on the specified task, using a custom icon file.

InnoSetup: How can you set the order of icons in the start menu?

I have the following [Icons] section in my Inno Setup script:
[Icons]
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\IA_Desktop.exe"; WorkingDir: {app}
Name: "{group}\{#MyAppName}"; Filename: "{app}\IA_Desktop.exe"; WorkingDir: {app}
Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}
I would expect that the order of the icons in the Start Menu -> group would be:
MyAppName
MyAppUrl
Uninstall
But instead I get:
MyAppUrl
Uninstall
MyAppName
What settings or other code do I need to use to set the order of the icons in the group?
Thanks!

Resources