Visit our Sponsor   Visit our Sponsor
delphi3000.com - the free delphi knowledge platform
delphi3000.com - the free delphi knowledge platform
498 Users Online NOW
Have a look at your member-status

connecting people's knowledge


  - Recent ArticlesRSS feed for Recent Articles on delphi3000.com
  - List of All Articles
  - Top Viewed Articles
  - Articles (+Attachem.)
  - Articles Of Interest
  - Categories
  - Top Uploader
  - Search
  - Index

  - My Home
  - Submit an Article
  - My Articles
  - My Personal Data
  - My Bookmarks
  - Activities
  - Login/Logout

  - Sign Up
  - Why Sign Up
  - Newsletter

  - Press
  - Advertise

  - Contact
  - Feedback





Community
Borland
ClubeDelphi
Dr. Bob
UK-BUG
Delphi Meetings
Planeta Delphi



Loremo - the 1.5 liter car coming in 2009




Startblatt.de






Share this article with friendsShare this article with friends
Rate this articleRate this article - to keep the quality of delphi3000.com !
Comment this article or read through previous comments (1)


D7 ActiveX Web deployment bug workaroundFormat this article printer-friendly!Bookmark function is only available for registered users!
Product:
Delphi 7.x (or higher)
Category:
ActiveX
Skill Level:
Scoring:
Last Update:
04/15/2003
Search Keys:
delphi delphi3000 article borland vcl code-snippet Delphi-7 web-deployment-bug manual-web-deployment
Times Scored:
3
Visits:
4316
Uploader: Robert White
Company:
Reference: http://codecentral.borland.com/codecentral/ccWeb.exe/listing?id=19752
 
Question/Problem/Abstract:
A workaround for Delphi 7 bug that disables Web Deployment.
Answer:



Delphi 7.0 contains a bug that disables Web Deployment after a project has been closed.  Web Deployment options are also disabled and, more's the pity, forgotten.  There's a workaround to reenable the Web Deployment menu items.

For the workaround, one would do the following steps:

1) open the Type Library viewer to familiarize oneself with the contents of the Type Library before adding the workaround form using menu: "View|Type Library".  The Alt-PrintScreen button takes a snapshot of the viewer that can be pasted into Wordpad for later comparison.

2) close the Type Library viewer.

3) add the ActiveForm to the library containing the target ActiveX using the new ActiveForm wizard accessed from menu: "File|New|Other...; tab: "ActiveX".

4) reopen the Type Library viewer and delete any items that had not been in the original Type Library (this is where the Wordpad image of the old Type Library is helpful).

But, this workaround does not recover the lost Web Deployment options.  There's another workaround, which is to do the web deployment manually.  So here are sample batch (BAT), Installation (INF) and HTML (HTM) files that show how to manually deploy your ActiveX control (using CABARC.EXE) and update the version/build number.  Essentially, the batch file contains the web deployment options that Delphi 7 is forgetting.

I wrote a batch file to recreate my CAB file using the Microsoft cabarc.exe utility (found at C:\Program Files\Borland\Delphi7\Bin in the default install).  My batch file reminds me to change the version numbers.  (Below, I number each batch file line in case the longer lines wrap around after I post this message).

<1>@echo off
<2>set  DESTDIR=C:\Inetpub\wwwroot\test
<3>set DESTFILE=fooControl.cab
<4>set  CONTROL=C:\DelphiProjects\REX\fooControl.ocx
<5>set     LIB1=C:\DelphiProjects\SetupFiles\Install\System32\stdvcl40.dll
<6>
<7>@echo off
<8>echo off
<9>echo Did you remember to update the Version info in the HTML file?
<10>echo off
<11>echo Did you remember to update the Version info in the INF file?
<12>PAUSE
<13>
<14>@echo ON
<15>move %DESTDIR%\%DESTFILE% %DESTDIR%\OLD_%DESTFILE%
<16>
<17>cabarc -c -s 6144 N %DESTDIR%\%DESTFILE% %CONTROL% %LIB1%
<18>cabarc L %DESTDIR%\%DESTFILE%

Remember, I use the original web deployment to create the test HTML file, Type Library, etc.  So all this batch file does is repackage the CAB file, and that's done in line <17>.  The last line <18> just displays the contents of the new CAB file.  I also keep a backup copy of the previous CAB file <15>.

Of course, one would need to replace the directory and file environment variables as appropriate for your ActiveX project.

As to version numbers, one can view the version number of the OCX by right-clicking the OCX file in Windows Explorer to view the file's properties.  This dialog contains a "Version" tab which displays the current version number.

One can also view and modify the version number from the menu: "Project|Options..."; tab: "Version Info".  If one checks the "Auto-increment build number" checkbox, the build number will be automatically incremented each time one rebuilds the project.  NOTE: this only happens when the project is rebuilt, not for simple "make" recompiles.

In order to test a new build, I transfer the version number to the tag in my HTML file, for example:

  classid="clsid:2E69...(whatever)...77CD"
  codebase="http://server/test/fooControl.inf#Version=1,0,6,1"
  width=350 height=250 align=center hspace=0 vspace=0
>


Next build would be...

  classid="clsid:...(your GUID here)..."
  codebase="http://server/test/fooControl.inf#Version=1,0,6,2"
  width=350 height=250 align=center hspace=0 vspace=0
>


...only the #Version tag changes.

Since I compress my deployment into a CAB file, I also have an INF file on my server to describe what needs to be downloaded.  In my example, I put both my target ActiveX control and the stdvcl70.dll in the same CAB file.  This means that my users are going to be downloading the DLL inside the compressed CAB file each time (even though it will only be extracted once).  But it also illustrates a more interesting INF file.

As you can see below, the INF file also designates the Version number of my target ActiveX control.

<1>;Delphi-generated INF file for fooControl.ocx
<2>[Add.Code]
<3>BarCodeRichEditXControl1.ocx=fooControl.ocx
<4>stdvcl40.dll=stdvcl40.dll
<5>
<6>[fooControl.ocx]
<7>file=http://server/test/fooControl.cab
<8>clsid={...(your GUID here)...}
<9>RegisterServer=yes
<10>FileVersion=1,0,6,1
<11>
<12>[stdvcl40.dll]
<13>file=http://server/test/fooControl.cab
<14>FileVersion=4,0,0,0
<15>DestDir=11

The version number of stdvcl40.dll will never change.  Again, the only line that needs to be updated is line <10> which sets the version number of the target ActiveX control.

This message has been posted in CodeCentral (ID 19752).

..Bob White.





Please rate this article!
Skill level:
BeginnerExpert

Useful:
No!Very!

Overall rating:
PoorExcellent



Comments to this article
Write a new comment
the solve
    fatih barut (Feb 27 2008 4:08PM)

Hi
This is a but as you know
Just hack it using a trick below,

Add a new activexform to project and remove it :))

this solution is got from
http://qc.borland.com/wc/qcmain.aspx?d=2584
Respond














 
Sign up to consume product discounts for Bronze memberships !

read more


  Visit our Sponsor

 

  Community Ad of
S. Carter
 
   














 







     
  Copyright © 2000 - 2007 delphi3000.com - All rights reserved. Terms of use. || Privacy
delphi3000.com is a service by bluestep.com IT-Services GmbH (Vienna)