Add a shortcut to a specified folder in InstallShield

Source: Internet
Author: User

Main idea: Sometimes you need to create a shortcut in the specified folder, depending on your business needs. Add a shortcut to any specified folder by InstallShield's Addfoldericon function.

Addfoldericon (Szprogramfolder, Szitemname, Szcommandline, Szworkingdir, Sziconpath, Nicon, SzShortCutKey, NFlag); /**/ /*--------------------------------------------------------------*

*

* InstallShield Example Script

*

* Demonstrates the Addfoldericon function.

*

* This example places a shortcut to an executable file on the

* Start Menu and the Start Programs menu.

*

* Note:before running this script, set the preprocessor

* Constants so they reference the fully-qualified

* Names of the Windows Notepad executable and a valid

* Text file on the target system.

*

*--------------------------------------------------------------*/



#define PROGRAM "C:/windows/notepad.exe"

#define PARAM "C:/windows/readme.txt"



STRING Szprogramfolder, Szitemname, Szcommandline, Szworkingdir, Sziconpath;

STRING Szshortcutkey, Szprogram, Szparam;

Number Nicon;



#include "ifx.h"

Program



Set up parameters for call to Addfoldericon.

Szprogramfolder = Folder_startmenu;

Szitemname = "Notepad Example 1";



Szprogram = Program;

Szparam = PARAM;

Longpathtoquote (Szprogram, TRUE);

Longpathtoshortpath (Szparam);



Szcommandline = Szprogram + "" + Szparam;



Szworkingdir = "";

Sziconpath = "";

Nicon = 0;

Szshortcutkey = "";



ADD a shortcut to the Start menu.

if (Addfoldericon (Szprogramfolder, Szitemname, Szcommandline, Szworkingdir,

Sziconpath, Nicon, Szshortcutkey, REPLACE) < 0) Then

MessageBox ("Addfoldericon failed.", SEVERE);

Else

Sprintfbox (Information, "Addfoldericon", "%s created successfully.",

Szitemname);

endif

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.