创建开始菜单快捷方式,创建桌面快捷方式,创建URL快捷方式,打开浏览器
szFolderName = FOLDER_STARTMENU;
CreateProgramFolder(szFolderName);
szCommandLine = TARGETDIR ^ "apache-tomcat-5.5.12//bin//startup.bat";
szCommandLine = "/"" + szCommandLine + "/"";
szFolderName = "xx//xx.exe";
AddFolderIcon(FOLDER_PROGRAMS, szFolderName, szCommandLine, TARGETDIR, "", 0, "", REPLACE);
szCommandLine = TARGETDIR ^ "apache-tomcat-5.5.12//bin//startup.bat";
szCommandLine = "/"" + szCommandLine + "/"";
szFolderName = "xx";
if (AddFolderIcon (FOLDER_DESKTOP, szFolderName, szCommandLine, TARGETDIR,
"", 0, "", REPLACE) < 0) then
MessageBox ("安装程序在进行桌面上添加快捷方式失败,稍侯请自己添加!.", SEVERE);
endif;
OpenFileMode (FILE_MODE_APPEND);
if(CreateFile (nvFileHandle, FOLDER_DESKTOP, "xx.url")>=0) then;
WriteLine (nvFileHandle, "[InternetShortcut]");
WriteLine (nvFileHandle, "URL=http://LocalHost:8080/index.jsp");
WriteLine (nvFileHandle, "IconFile=" + TARGETDIR ^ "images//icon.ico");
WriteLine (nvFileHandle, "IconIndex=0");
CloseFile (nvFileHandle);
else
MessageBox ("桌面快捷方式创建失败!",SEVERE);
endif;
szCmdLine = "http://LocalHost:8080/index.jsp";
if (LaunchApp(PROGRAMFILES ^"Internet Explorer"^"IEXPLORE.EXE", szCmdLine) < 0) then
MessageBox ("不能打开浏览器.",SEVERE);
endif;