gary_baird
Posts: 5
Joined: Wed May 13, 2009 5:47 pm

Conditional shortcut

I can't see a way to make the Shortcuts Conditional. When I assign it to a component it doesn't install the main application if they do not choose to install the desktop shortcut. If I make it an internet Shortcut I have to provide an icon. Isn't there a better way? I also created vbs script, but it does not execute in the right place. In any case I can generate icons just not based on a user choice.

Code: Select all

' GLB 05/11/09*2:42PM
'usage: Pass [Shortcut_Name],[Directory_Path],[Application_Name]+[Extension],[ICON_Path]+[ICON_Extension] with each Item in Quotes if there are spaces
'like \Program Files (x86)\ would be "\Program Files (x86)\".

On Error Resume Next

If WScript.Arguments.Count >= 1 Then
	Call CreateShortcuts(WScript.Arguments(0), WScript.Arguments(1), WScript.Arguments(2), WScript.Arguments(3))

End If

Sub CreateShortcuts (scName, scDir, scPgm, scIco)
	Set WshShell = WScript.CreateObject("WScript.Shell")
	strDesktop = WshShell.SpecialFolders("Desktop")
	set oShellLink = WshShell.CreateShortcut(strDesktop & "\" & scName & ".lnk")
	WScript.Echo (strDesktop + "\" + scName + ".lnk")
	oShellLink.TargetPath = scDir & scPgm 
	oShellLink.WindowStyle = 1
	oShellLink.Hotkey = ""
	oShellLink.IconLocation = scDir & scIco & ", 0"
	oShellLink.Description = scName
	oShellLink.WorkingDirectory = strDesktop
	oShellLink.Save
End Sub
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Re: Conditional shortcut

Hi,

Note that this can be done by adding the "ShortcutsDlg" in dialogs page. See section 7 from:
http://www.advancedinstaller.com/user-g ... alogs.html

Regards,
Gigi
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com/
lwardwell
Posts: 8
Joined: Tue May 17, 2011 5:03 pm

Re: Conditional shortcut

Hi, I've added my shortcuts to an installed file in the Files and Folders section i.e. Desktop, Program Menu, StartMenu, not sure where QuickLaunch should be though... and added the ShortcutsDlg for conditional install of all four.

1) Defaulting the ShortcutsDlg checkboxes ON, installs shortcut(s). OK.
2) Defaulting the ShortcutsDlg checkboxes ON and runtime check OFF, does not install shortcut(s). OK.
3) Defaulting the ShortcutsDlg checkboxes OFF and runtime checked OFF, does not install shortcut(s). OK.
4) Defaulting the ShortcutsDlg checkboxes OFF and runtime check ON, does not install shortcut(s). NOT OK.

What am I doing wrong for step 4? Thanks.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Conditional shortcut

Hello,

I cannot reproduce this behavior using our latest release( 8.1.3 ). Can you please upgrade to the latest version and see if the problem persists?

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
lwardwell
Posts: 8
Joined: Tue May 17, 2011 5:03 pm

Re: Conditional shortcut

I have 8.1.3. I downloaded the trial version to evaluate just for this feature.

I finally got it working by removing the shortcutsDlg and shortcuts and then re-adding them and then re-adding the dialog.

I see in the ShortcutsDlg.aip that the QLT checkbox is hidden if VersionNT >= 601 which is Windows 7 and 2008 R2. Will there be any support for these to add the shortcut to the Taskbar which is now in App Data\Roaming\Microsoft\Internet Explorer\Quick Launch ? Thanks.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Conditional shortcut

Hello,

The Quick Launch Toolbar is disabled by default in both Windows 7 and Windows Server 2008 and this is the reason for the checkbox control condition. Here is a technet article that underlines this.

If you want, you can manually remove that condition yourself.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”