Article View: borland.public.cppbuilder.nativeapi
Article #11732How to install a cab file
From: eric67
Date: Wed, 21 Jan 2004 20:07
Date: Wed, 21 Jan 2004 20:07
72 lines
2963 bytes
2963 bytes
How can I install a cab file from code?
I'm using a third part activex control in a cppbuilder app. I need to
deploy the activex control on target machines. The author provides me
a cab file (written for internet download) with two files in:
sample.inf
sample.dll
sample.dll must be
1) copied into c:\windows\system32\sample\sample.dll
2) registered
I used the following syntax:
WinExec("c:/windows/sistem32/rundll32.exe
setupapi,InstallHinfSection DefaultInstall 132
c:/mysetuppath/sample.inf" ..);
and the dll is actually copied to destination but it's not registered.
I think that the problem is in the inf file i.e. I can't use the inf
file outside the cab file. I think I should install the cab file i.e I
can't manually explode the cab and run the inf file. Am I right?
Here is the full sample.inf:
; sample ActiveX installation
[version]
signature="$CHICAGO$"
AdvancedINF=2.0
;installation information sections
[DefaultInstall]
CopyFiles=InstallFilesSection,InstallInfSection
RegisterOCXs=RegisterOCXSection
[DefaultUninstall]
; cleanup=1 will cause the inf file to be removed
cleanup=1
Delfiles=sample.dll
UnRegisterOCXs=UnRegisterOCXSection
[RegisterOCXSection]
%11%\sample\sample.dll
[UnRegisterOCXSection]
%11%\sample\sample.dll
;files to be copied to the user's machine
[InstallFilesSection]
sample.dll=sample.dll
[InstallInfSection]
sample.inf=sample.inf
;source location for specified platform version
[sample.dll]
file-win32-x86=thiscab
FileVersion=2,0,0,0
RegisterServer=yes
;source location for specified platform version
[sample.inf]
file-win32-x86=thiscab
FileVersion=1,0,0,0
;destination directory for files in the CopyFiles section
[DestinationDirs]
InstallFilesSection=11,sample ;new folder in windows system drive
(\winnt\system32)
InstallInfSection=17 ;Windows\Inf folder
I think I have two choices:
1) rewrite the inf file (never done! howto?)
2) install the cab file directly
Technical Details
Message-ID:
<400edac4@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!news.belwue.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,8e64f91dc9dc3b30,start X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2004-01-21 12:10:55 PST From: "eric67" <myfantasy@libero.it> Newsgroups: borland.public.cppbuilder.nativeapi Subject: How to install a cab file Date: Wed, 21 Jan 2004 21:07:45 +0100 Lines: 74 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 217.56.76.254 Message-ID: <400edac4@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1074715332 217.56.76.254 (21 Jan 2004 12:02:12 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!news.belwue.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail