我要安装的时候查找注册表找到另一个程序的安装路径或者让用户输入这个路径,然后将这个路径加到PATH中去,要安装在WIN2000下,程序是用DELPHI编的。
我现在用InstallShield Express For Delphi 5能不能实现上述的功能,我该怎样做啊?急啊!!各位大虾帮帮吧!!!!

解决方案 »

  1.   

    这就比较复杂了,只有换个工具。用微软的做安装的工具。installshell.
      

  2.   

    to honey_001:
      installshell 用起来方便吗?在哪里有下裁?有帮助吗?
      

  3.   

    有人熟悉InstallShield的脚本语言吗?
    如果用它编一断代码让用户输入另一个程序的路径,然后将它写到win2000的PATH变量中该怎样写啊?
    有没有人知道啊?
      

  4.   

    用     AskText(szQuestion,szDefault,svResult)来让用户输入路径,
    RegDBSetKeyValueEx("SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment" ,"Path" , REGDB_STRING ,"c:\",-1)来加入路径win200的路径在注册表内
      

  5.   

    用InstallShield确实可以实现,而且很简单,但程序太大,有六十多兆,不易下载,建议版本6.1,别忘了语言包
      

  6.   

    to bell:
    谢谢,要是在WIN98下能不能用
    RegDBSetKeyValueEx("SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment" ,"Path" , REGDB_STRING ,"c:\",-1)来加入路径?在RegDBSetKeyValueEx中"c:\",-1这两个参数是什么意识啊?
      

  7.   

    我试过了用RegDBSetKeyValueEx("SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment" ,"Path" , REGDB_STRING ,"c:\",-1)来加入路径,好象不行! 还有没有其他办法?
      

  8.   

    给你一段demo
    function OnFirstUIAfter()
      STRING svResult,szKey,szPath,szRefDir;  
      STRING svTargetDir;
      NUMBER nResult,nvResult;
      NUMBER bvOpt1,bvOpt2,bvOpt3;
    begin

      SdShowMsg ( "安装程序正在创建注册表键值" , TRUE );
      svTargetDir = TARGETDIR;
      LongPathToShortPath(svTargetDir);
      
      RegDBSetKeyValueEx ( "Software\\Borland\\Database Engine" , "CONFIGFILE01" , REGDB_STRING , TARGETDIR+"\\IDAPI.CFG" , -1 );
      RegDBSetKeyValueEx ( "Software\\Borland\\Database Engine" , "DLLPATH" , REGDB_STRING , TARGETDIR , -1 );
        if nOS == IS_WINDOWS9X then
        if (BatchFileLoad ('') < 0) then
          MessageBox ("不能打开Autoexec.bat文件! " , SEVERE);
        endif;
        szKey     = "Lib=";
        szPath    = svTargetDir+"\\Sybase\\Lib";
        szKey     = szKey+szPath;
        szRefDir  = "";
        SdShowMsg ( "安装程序正在创建Sybase 库环境,请稍候..." , TRUE );  
        if (EzBatchReplace ("SET Lib="+szPath) < 0) then
          if ( EzBatchAddString (szKey,"Lib",AFTER|REPLACE ) <0) then
            MessageBox ("添加Sybase库环境失败!", SEVERE);
          endif;
        endif;
        SdShowMsg ( "安装程序正在创建Sybase 类环境,请稍候..." , TRUE );  
        szKey  = "ClassPath" ;
        szPath = svTargetDir+"\\Sybase\\ASEP\\Monclass.zip;"+
                 svTargetDir+"\\Sybase\\ASEP\\3pclass.zip" ;
        if ( EzBatchAddPath (szKey,szPath,"",AFTER|REPLACE ) <0) then
          MessageBox ("添加Sybase类环境失败!", SEVERE);
        endif;
        szKey     = "Sybase=";
        szPath    = svTargetDir+"\\Sybase";
        szKey     = szPath;
        szRefDir  = "";
        SdShowMsg ( "安装程序正在创建Sybase 路径环境,请稍候..." , TRUE );  
        try
          if (EzBatchReplace ("SET Sybase="+szPath) < 0) then
            if (EzBatchAddString (szKey,"", AFTER) < 0) then
              MessageBox ("添加Sybase路径环境失败!", SEVERE);
            endif;
          endif;
          SdShowMsg ( "安装程序正在创建Sybase 工作路径环境,请稍候..." , TRUE );        szKey     = "PATH";
          szPath    = svTargetDir+"\\Sybase\\asep;"+svTargetDir+"\\sybase\\dll;"+svTargetDir+"\\sybase\\bin";
          szRefDir  = "";
      
          if (EzBatchAddPath (szKey, szPath, szRefDir, AFTER|REPLACE) < 0) then
            MessageBox ("添加Sybase路径失败!", SEVERE);
          endif;
        catch
          MessageBox ( "安装程序创建环境错误,请整理Autoexec.bat文件!" , SEVERE );
          abort;
        endcatch;
        SdShowMsg("",FALSE);
      endif;//end win9x
      //NT下使用
      if nOS == IS_WINDOWSNT then
        SdShowMsg ( "安装程序正在创建注册表键值" , TRUE );
        szPath    = svTargetDir+"\\Sybase\\Asep\\MonClass.zip;" +
                         svTargetDir+"\\Sybase\\Asep\\3pClass.zip";
        RegDBSetKeyValueEx("SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment" ,
                         "ClassPath" , REGDB_STRING , szPath , -1 );
        RegDBSetKeyValueEx("SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment" ,
                         "Sybase" , REGDB_STRING , svTargetDir+"\\Sybase" , -1 );
        RegDBSetKeyValueEx("SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment" ,
                         "Lib" , REGDB_STRING , svTargetDir+"\\Sybase\\Lib" , -1 );
        GetEnvVar ("PATH", szPath);
        Disable(LOGGING);
        RegDBSetKeyValueEx("SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment" ,
                         "Path" , REGDB_STRING ,
           szPath+";"+svTargetDir+"\\Sybase\\asep;"+svTargetDir+"\\sybase\\dll;"+
           svTargetDir+"\\sybase\\bin" , -1 );
        Enable(LOGGING);
        RegDBSetKeyValueEx("\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\"+PRODUCT_GUID,
                         "UninstallString" , REGDB_STRING ,DISK1TARGET+"\\setup.exe",-1);
        
      endif;                     
    end;
      

  9.   

    RegDBSetKeyValueEx (szKey, szName, nType, szValue, nSize);Parameters
    szKey
    Specifies the name of the key to set; the key must already have been created with RegDBCreateKeyEx. You do not have to include the HKEY_CLASSES_ROOT key (or another specified key) in this parameter. Separate different levels in the subkey with a double backslash (\\).
    szName
    Specifies the value name for the value data to set be set. To set the default value of the key specified in szKey, pass a null string ("") in this parameter.
    nType
    Specifies the type of data to be set. Pass one of the following predefined constants in this parameter: