用installshield做安装程序,如何才能在开始菜单里加一个反安装的东西啊..

解决方案 »

  1.   

    This system variable contains the command line that will launch the copy of Setup.exe that was placed on the target system to perform uninstallation. This command line is placed in the appropriate registry value by the MaintenanceStart function, which is called automatically in event-based setups.The value of this system variable is shared among object scripts and between object scripts and the main setup script. The value you assign to this system variable in any script is the value it has in the subsequently executed code in any script (until its value is explicitly reset).You can append your own custom command line switches to UNINSTALL_STRING for processing by your script's uninstallation code. If you do so, and you change the value of the system variable DISK1TARGET, be sure to change DISK1TARGET before appending to UNINSTALL_STRING; UNINSTALL_STRING incorporates DISK1TARGET and is automatically changed when you change DISK1TARGET.
      

  2.   

    在scripts>functions>onmoving中加入以下代码: if (!MAINTENANCE) then 
    szProgram = UNINSTALL_STRING; 
    AddFolderIcon( FOLDER_PROGRAMS^"\\软件相对路径\\", "卸载程序", szProgram, TARGETDIR, TARGETDIR^"卸载程序图片相对路径", 0, "", REPLACE); 
    Delay( 1 ); 
    endif; 
    end;祝好运。
      

  3.   

    在反安装过程序中如何找到它的反安装文件的路径啊.如:
    "D:\Program Files\InstallShield Installation Information\{5D28A520-A7BD-11D5-85F2-2323E8400C97}\Setup.exe"
      

  4.   

    把下面的函数改改并在OnFirstUIAfter事件中调用一下就行了。
    //创建反安装的快捷菜单
    function CreateUninstallShortCut()
    STRING strProgramFolder,strItemName,strCommandLine,strWorkingDir;
    STRING strIconPath,strShortCutKey,strProgram,strParam,strT,strT1;
    NUMBER lngIcon,lngFlag,lngPos,lngLen;
    begin
        strProgramFolder = FOLDER_PROGRAMS ^ SHELL_OBJECT_FOLDER;
        strItemName = "you named string";//@CSUNINSTALLNAME ;
        strWorkingDir = "";
        strIconPath = "";
        strShortCutKey = "";
        lngIcon = 0;
        lngFlag = REPLACE;
        //处理反安装程序及路径
        strParam = UNINSTALL_STRING;
        //为了得到一个空加上一个双引号的字符串
        strT1 = " " ;
        LongPathToQuote(strT1,TRUE);
        StrSub ( strT , strT1 , 1 , 2 );
        //把反安装程序的路径过滤出来
        lngPos = StrFind ( strParam , strT );
        StrSub ( strProgram , strParam , lngPos+1 , 1000 );
        strCommandLine = strProgram ;
        //创建反安装程序的快捷菜单
        AddFolderIcon ( strProgramFolder , strItemName , strCommandLine , strWorkingDir , strIconPath , lngIcon , strShortCutKey , lngFlag );
                                
    end;
      

  5.   

    多谢你的回复,AddFolderIcon 为何只能一个啊.
    我想在
    开始/程序/程序文件夹/项目名1 
    开始/程序/程序文件夹/项目名2
    开始/程序/程序文件夹/项目名3这样多加几项如何做呢...
    如金山快译 2003文件夹下有"高质量全文翻译" "金山快译 2003"等项目一样
      

  6.   

    NUMBER nResult;
     STRING szProgramFolder, szItemName, szCommandLine, szWorkingDir, szIconPath;
     STRING szShortCutKey, szProgram, szParam,svTmp;
     NUMBER nIcon, nFlag;//快捷方式1...
     nIcon           = 0;
     szShortCutKey   = "";
     nFlag           = REPLACE;
     szWorkingDir    = TARGETDIR;
     szIconPath      = TARGETDIR+"\\help.chm";
     szItemName      = "帮助"; 
     szCommandLine   =TARGETDIR+"\\help.chm"; if (AddFolderIcon(szProgramFolder, szItemName, szCommandLine, szWorkingDir,
                       szIconPath, nIcon, szShortCutKey, nFlag) < 0) then
        return -1;
     endif;
    //快捷方式2...
     nIcon           = 0;
     szShortCutKey   = "";
     nFlag           = REPLACE;
     szWorkingDir    = TARGETDIR;
     szIconPath      = TARGETDIR+"\\help1.chm";
     szItemName      = "帮助1"; 
     szCommandLine   =TARGETDIR+"\\help1.chm"; if (AddFolderIcon(szProgramFolder, szItemName, szCommandLine, szWorkingDir,
                       szIconPath, nIcon, szShortCutKey, nFlag) < 0) then
        return -1;
     endif;
      

  7.   

    讲白了,你有几个快捷方式,就引用几个AddFolderIcon过程。