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
Sign up to consume product discounts for Bronze memberships !