希望客户端ie下载之后可以注册com,还能把控件需要的图片资源保存在我希望的目录下。
各位一般遇到类似情况,是把资源统统放在cab里,还是等控件安装好之后再去下载资源?
高手们帮帮忙吧~~

解决方案 »

  1.   

    不想都写在dll中,想安装到一个目录,有办法吗?
      

  2.   

    为什么不把图片和声音资源放在web server上? COM运行的时候自动去网上下载这些资源.
      

  3.   

    会“自动”下载吗?还是需要自己写下载功能?
    比如说我有一个调用fopen("a.txt","r")
    如果可以自动下载,文件要放在服务器的什么位置?
      

  4.   

    Necromancerr(男巫)兄如果解决了别忘了告诉小弟
      

  5.   

    [Version]
    Signature="$Chicago$"
    AdvancedINF=2.5[DefaultInstall]
    CopyFiles=InstallFilesSection,InstallInfSection
    RegisterOCXs=RegisterOCXSection[DefaultUninstall]
    cleanup=1
    Delfiles=InstallFilesSection
    UnRegisterOCXs=UnRegisterOCXSection;该节写入需要注册的路径和文件名
    [RegisterOCXSection]
    %11%\xxx.ocx[UnRegisterOCXSection]
    %11%\xxx.ocx;该节写入你想要安装的所有文件
    ;YourActiveX、File1、File2代表需要安装的文件
    [InstallFilesSection]
    YourActiveX=xxx.ocx
    File1=a.bmp
    File2=b.wav;inf文件的名称和节
    [InstallInfSection]
    infFile=your.inf;文件,注册
    [YourActiveX]
    file-win32-x86=thiscab
    RegisterServer=yes;文件,不需注册
    [File1]
    file-win32-x86=thiscab
    RegisterServer=no;文件,不需注册
    [File2]
    file-win32-x86=thiscab
    RegisterServer=no;指明安装路径
    [DestinationDirs]
    InstallFilesSection=11
    InstallInfSection=17
    我这里有一个CAB包的链接,同你的情况很类似,多个需要安装的文件在同一个CAB包中,你可以下载回来研究研究,参考写一个应该就能解决问题。http://diwww.globalenglish.com/@v=700@/html/setup/cabs/ge.cab
      

  6.   

    上面的路径%11%代表System32目录,其它的目录数字可以在MSDN中找到。下面的表格显示了不同目录的数字代表。Value   Destination Directory 
    01      SourceDrive:\pathname (the directory from which the INF file was installed) 
    10      Windows directory, This is equivalent to %windir%.  
    11      System directory, This is equivalent to %windir%\system32 for NT-based systems, and to %windir%\system for Windows 9x/Me. 
    12      Drivers directory, This is equivalent to %windir%\system32\drivers for NT-based platforms, and to %windir%\system\IoSubsys on Windows 9x/Me platforms.  
    17      INF file directory 
    18      Help directory 
    20      Fonts directory 
    21      Viewers directory 
    23      Color directory (ICM) (not used for installing printer drivers) 
    24      Root directory of the system disk.This is the root directory of the disk on which Windows files are installed. For example, if dirid 10 is "C:\winnt", then dirid 24 is "C:\". 
    25      Shared directory 
    30      Root directory of the boot disk, also known as "ARC system partition," for NT-based systems. (This might or might not be the same directory as the one represented by dirid 24.) 
    50      System directory for NT-based operating systems, This is equivalent to %windir%\system (NT-based systems only). 
    51      Spool directory (not used for installing printer drivers – see Printer Dirids) 
    52      Spool drivers directory (not used for installing printer drivers) 
    53      User profile directory 
    54      Directory where ntldr.exe and osloader.exe are located (NT-based systems only)  
    55      Print processors directory (not used for installing printer drivers) 
    -1 Absolute path  
      

  7.   

    下面的表格显示了特殊目录的数字代表Value   Shell Special Folder 
    16406   All Users\Start Menu  
    16407   All Users\Start Menu\Programs  
    16408   All Users\Start Menu\Programs\Startup 
    16409   All Users\Desktop 
    16415   All Users\Favorites 
    16419   All Users\Application Data 
    16422   Program Files 
    16427   Program Files\Common 
    16429   All Users\Templates 
    16430   All Users\Documents 
      

  8.   

    CString CDownInfoDlg::DownURL(CString strURL)
    {
    CInternetSession m_Session("DigitalTitan");
        CHttpFile* pFile=NULL;
    CException* e; TCHAR szTempPath[MAX_PATH],szTempFile[MAX_PATH];
        DWORD dwResult=::GetTempPath(MAX_PATH,szTempPath);
    CString strURLPath;
    GetTempFileName(szTempPath,_T("DigitalTitan_"),0,szTempFile);
    strURLPath=szTempFile;
        TRY
    {
    pFile=(CHttpFile*)m_Session.OpenURL(strURL);
    }
    CATCH_ALL(e)
    {
    pFile=NULL;
    AfxMessageBox("URL地址不合法",MB_ICONINFORMATION);
    return "";
    }
    END_CATCH_ALL if(pFile)
    {
    DWORD dwStatus;
    DWORD dwBufLen=sizeof(dwStatus);
    BOOL bSuccess=pFile->QueryInfo(HTTP_QUERY_STATUS_CODE|HTTP_QUERY_FLAG_NUMBER,&dwStatus,&dwBufLen);
    if(bSuccess&&dwStatus>=200&&dwStatus<300)
    {
    CStdioFile m_File;
    if(m_File.Open(strURLPath,CFile::modeWrite|CFile::modeCreate|CFile::typeBinary))
    {
    BYTE pBuf[1024];
    DWORD dwRead;
    do
    {
    dwRead=pFile->Read(pBuf,1024);
    m_File.Write(pBuf,dwRead);
    }
    while(dwRead>0);
    m_File.Close();
    }
    }
    pFile->Close();
    delete pFile;
    }
    else
    {
    m_Session.Close();
    }
    return strURLPath;
    }
      

  9.   

    如果我的cab包里是一个setup.exe的安装文件,我想让其自动执行安装。这种情况下,inf文件
    该怎么写呢?