问题
I think I need to create a manifest file for MSCOMCTL.ocx to use in my VB6 application (reg free)
I will also need to update/create the .res file Then I will need to use ManifestCreatorII It has been a few years (2017) and I have forgotten the steps and cannot find my old notes.
I ~remember how to work with the NSI to generate the install package. Without this, I cannot get my applications to run on a new Win 10 PC.
My Development PC is a virtual PC running Windows XP (32bit) Service Pack 3. I am programming with Visual Basic 6.0 (SP6).
Working through these experiments taught me that I do NOT really need manifest files for each of the Dependency .ocx files used for the Components in my VB6 programs.
I really only need the one manifest file for the application program as a whole and that is used to create the Resource file for the project.
My problem was first indicated when I installed the NSIS package and ran its VB6 program on a new Win10(64) PC:
Run-time error 339: Component 'MSCOMCTL.OCX' or one of its dependencies not correctly registered: a file is missing or invalid
I got this Error message when I tried to open one of the more recently added forms.
A unique feature of this form is the use of Tabbed Dialogue Controls (TabStrip) which references MSCOMCTL.ocx.
re: https://www.processlibrary.com/en/directory/files/mscomctl/19764/
mscomctl.ocx is an ActiveX Control module that contains common controls used by Windows, such as ImageCombo, ImageList, ListView, ProgressBar, Slider, StatusBar, TabStrip, ToolBar, and TreeView controls.
I created a tiny program, zMSCOMCTL, which has one form containing only two controls (TabStrip and ProgressBar) both from the one MSCOMCTL.ocx Component.
I plagiarized from VB6 code and NSIS of my similar tiny programs (e.g.: zRichTx, zThreeD, zCOMDLG).
When I install and try to run zMSCOMCTL on my new Win10(64) PC, I get this same error message: Run-time error 339: Component 'MSCOMCTL.OCX' or one of its dependencies not correctly registered: a file is missing or invalid
I downloaded a copy MSCOMCTL.ocx version 6.1.98.46 from https://www.ocxme.com
These instructions are based on: https://originaldll.com/file/mscomctl.ocx/16903.html
- Made a backup copy of:
C:\WINDOWS\system32\MSCOMCTL.*
- In the Command Prompt Window:
regsvr32 /u MSCOMCTL.ocx
- Deleted
C:\WINDOWS\system32\MSCOMCTL.*
- Copied the new
MSCOMCTL.ocx
intoC:\WINDOWS\system32
- REBOOT
- In the Command Prompt Window:
regsvr32 MSCOMCTL.ocx
FIRST trial method:
A. create MSCOMCTL.ocx.manifest:
- In the Command Prompt Window:regsvr42 MSCOMCTL.ocx
- I used NotePad++ to Modify
.sxs.
changed to.ocx.
type="win32"
changed toprocessorArchitecture="x86" type="win32"
<file name="MSCOMCTL.ocx">
changed to<file name="Dependencies\MSCOMCTL.ocx">
To improve chances of ManifestCreatorv2.0.3 accepting MSCOMCTL.ocx.manifest file instead of requiring ClipBoard copy. (No srtrange characters or blanks)
- First, Edit MSCOMCTL.ocx.manifest with Notepad++
- Select All, Copy, Paste into NotePad and Save to MSCOMCTL.ocx.manifest
B. Create zMSCOMCTL.exe.manifest
- Open ManifestCreatorv2.0.3:
- The Manifest > Create from Project File (vbp) zMSCOMCTL.vbp
- The Manifest > Append/Merge Manifest - From file MSCOMCTL.ocx.manifest
- The Manifest > Export Manifest - Destination Disk File
- save to zMSCOMCTL.exe.manifest (Replace)
re: http://www.vbforums.com/showthread.php?845909-VB6-Manifest-Creator-II
C. Create zMSCOMCTL.res
Shut Down VB6 zMSCOMCTL Project or remove zMSCOMCTL.res from Project
Open ManifestCreatorv2.0.3:
The Manifest > Create from Project File (vbp) zMSCOMCTL.vbp
The Manifest > Append/Merge Manifest - From file MSCOMCTL.ocx.manifest
The Manifest > Export Manifest
- [_] Indent Manifest
- [_] Do Not Use Prefixed Name Spaces
- [x] Do Not Export Empty/Blank Attributes
- Destination Resource File - save to zMSCOMCTL.res (Replace)
D. Make new zMSCOMCTL.exe
- Open VB6 zMSCOMCTL Project or Add zMSCOMCTL.res back into Project
- Within VB6 zMSCOMCTL Project, start with full compile: Runs OK
- Within VB6 zMSCOMCTL Project, File -> Make new executable:
Running the new executable: zMSCOMCTL.exe Results in:
This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.
This is the end of the FIRST trial method (which failed)
Re: VB6 RegFreeCom SideBySide SxS Manifest Test for TABCTL32.ocx
Successful Process:
I downloaded UMMM from https://github.com/wqweto/UMMM
[Find_file] [_Clone_or_download_v] Click on the Green Button
Clone with HTTPS Use Git or checkout with SVN using the web URL.
[https://github.com/wqweto/UMMM.git]
[Open_in_Desktop] [Download_ZIP] Then Click on Download_ZIP Button
- I expanded the downloaded UMMM-master.zip file.
- The resulting .\src folder contained files: mdUmmm.bas and Ummm.vbp.
- I copied them to their own UMMM-master Project folder
- I took a quick look at mdUmmm.bas and Ummm.vbp.
- The Ummm.vbp referred to
SysWOW64
. - In Notepad, I changed it to
System32
.Development platform is WinXP(32)
- I opened Ummm.vbp with VB6
- I did a File - Make to create UMMM.exe
- I copied UMMM.exe to C:\Program Files\Support Tools\
in %path%
These are the reference links I have found for UMMM Unattended Make My Manifest
:
- https://github.com/wqweto/UMMM
- Generate manifest files for registration-free COM
- Registration free COM: VB6 Executable referencing VB6 DLL
- https://github.com/wqweto/UMMM/blob/master/Sample.ini
- http://www.vbforums.com/showthread.php?840333-SXS-and-UMMM-with-inter-thread-marshalling
- https://github.com/wqweto/UMMM/issues/9
- https://github.com/wqweto/UMMM/issues/16
The 1st link is where I got my clues to create the .ini file.
The 6th link helped me create a bat file that seems to work!
zMSCOMCTLUMMM.ini
This .ini file, following the Identity line, contains a list of dependency files. They are listed in the .vbp file (e.g.: Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.2#0; mscomctl.ocx ).
You can also find them itemized within VB6 Menu > Project > Components ...
On that Components form, you can choose [x] Selected Items Only to more easily view the list.
Highlighting each Component in the list will display, below: (e.g.: Location C:\ ... \MSCOMCTL.OCX )
In the .ini file, I specify the path to the dependency file because it is not stored in the local Project folder.
Identity zMSCOMCTL.exe zMSCOMCTL.exe "MSCOMCTL Test program 1.0"
File C:\WINDOWS\system32\mscomctl.ocx
zMSCOMCTLUMMM.bat
UMMM.exe zMSCOMCTLUMMM.ini .\manifest\zMSCOMCTL.exe.manifest
pause done?
Is there a way to specify File Name= in UMMM (Unattended Make My Manifest) creation of Program.exe.manifest?
I edited the resulting zMSCOMCTL.exe.manifest with Notepad and changed:
From: <file name="..\..\..\..\WINDOWS\system32\MSCOMCTL.ocx">
To: <file name="Dependencies\MSCOMCTL.ocx">
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<assemblyIdentity name="zMSCOMCTL" processorArchitecture="X86" type="win32" version="1.1.0.24" />
<description>MSCOMCTL Test program 1.0</description>
<file name="Dependencies\MSCOMCTL.ocx">
<typelib tlbid="{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}" version="2.2" flags="control,hasdiskimage" helpdir="" />
<comClass clsid="{1EFB6596-857C-11D1-B16A-00C0F0283628}" tlbid="{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}" progid="MSComctlLib.TabStrip.2" threadingModel="Apartment" miscStatus="" miscStatusContent="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,setclientsitefirst">
<progid>MSComctlLib.TabStrip</progid>
</comClass>
<comClass clsid="{24B224E0-9545-4A2F-ABD5-86AA8A849385}" tlbid="{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}" threadingModel="Apartment" miscStatus="" miscStatusContent="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,setclientsitefirst" />
<comClass clsid="{9A948063-66C3-4F63-AB46-582EDAA35047}" tlbid="{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}" threadingModel="Apartment" miscStatus="" miscStatusContent="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,setclientsitefirst" />
<comClass clsid="{66833FE6-8583-11D1-B16A-00C0F0283628}" tlbid="{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}" progid="MSComctlLib.Toolbar.2" threadingModel="Apartment" miscStatus="" miscStatusContent="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,actslikelabel,alignable,simpleframe,setclientsitefirst">
<progid>MSComctlLib.Toolbar</progid>
</comClass>
<comClass clsid="{7DC6F291-BF55-4E50-B619-EF672D9DCC58}" tlbid="{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}" threadingModel="Apartment" miscStatus="" miscStatusContent="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,actslikelabel,alignable,simpleframe,setclientsitefirst" />
<comClass clsid="{8B2ADD10-33B7-4506-9569-0A1E1DBBEBAE}" tlbid="{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}" threadingModel="Apartment" miscStatus="" miscStatusContent="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,actslikelabel,alignable,simpleframe,setclientsitefirst" />
<comClass clsid="{8E3867A3-8586-11D1-B16A-00C0F0283628}" tlbid="{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}" progid="MSComctlLib.SBarCtrl.2" threadingModel="Apartment" miscStatus="" miscStatusContent="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,actslikelabel,alignable,setclientsitefirst">
<progid>MSComctlLib.SBarCtrl</progid>
</comClass>
<comClass clsid="{627C8B79-918A-4C5C-9E19-20F66BF30B86}" tlbid="{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}" threadingModel="Apartment" miscStatus="" miscStatusContent="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,actslikelabel,alignable,setclientsitefirst" />
<comClass clsid="{585AA280-ED8B-46B2-93AE-132ECFA1DAFC}" tlbid="{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}" threadingModel="Apartment" miscStatus="" miscStatusContent="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,actslikelabel,alignable,setclientsitefirst" />
<comClass clsid="{35053A22-8589-11D1-B16A-00C0F0283628}" tlbid="{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}" progid="MSComctlLib.ProgCtrl.2" threadingModel="Apartment" miscStatus="" miscStatusContent="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,actslikelabel,alignable,setclientsitefirst">
<progid>MSComctlLib.ProgCtrl</progid>
</comClass>
<comClass clsid="{A0E7BF67-8D30-4620-8825-7111714C7CAB}" tlbid="{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}" threadingModel="Apartment" miscStatus="" miscStatusContent="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,actslikelabel,alignable,setclientsitefirst" />
<comClass clsid="{C74190B6-8589-11D1-B16A-00C0F0283628}" tlbid="{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}" progid="MSComctlLib.TreeCtrl.2" threadingModel="Apartment" miscStatus="" miscStatusContent="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,setclientsitefirst">
<progid>MSComctlLib.TreeCtrl</progid>
</comClass>
<comClass clsid="{9181DC5F-E07D-418A-ACA6-8EEA1ECB8E9E}" tlbid="{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}" threadingModel="Apartment" miscStatus="" miscStatusContent="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,setclientsitefirst" />
<comClass clsid="{95F0B3BE-E8AC-4995-9DCA-419849E06410}" tlbid="{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}" threadingModel="Apartment" miscStatus="" miscStatusContent="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,setclientsitefirst" />
<comClass clsid="{DD2DBE12-F9F8-4E32-B087-DAD1DCEF0783}" tlbid="{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}" threadingModel="Apartment" miscStatus="" miscStatusContent="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,setclientsitefirst" />
<comClass clsid="{BDD1F04B-858B-11D1-B16A-00C0F0283628}" tlbid="{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}" progid="MSComctlLib.ListViewCtrl.2" threadingModel="Apartment" miscStatus="" miscStatusContent="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,setclientsitefirst">
<progid>MSComctlLib.ListViewCtrl</progid>
</comClass>
<comClass clsid="{996BF5E0-8044-4650-ADEB-0B013914E99C}" tlbid="{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}" threadingModel="Apartment" miscStatus="" miscStatusContent="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,setclientsitefirst" />
<comClass clsid="{979127D3-7D01-4FDE-AF65-A698091468AF}" tlbid="{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}" threadingModel="Apartment" miscStatus="" miscStatusContent="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,setclientsitefirst" />
<comClass clsid="{CCDB0DF2-FD1A-4856-80BC-32929D8359B7}" tlbid="{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}" threadingModel="Apartment" miscStatus="" miscStatusContent="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,setclientsitefirst" />
<comClass clsid="{2C247F23-8591-11D1-B16A-00C0F0283628}" tlbid="{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}" progid="MSComctlLib.ImageListCtrl.2" threadingModel="Apartment" miscStatus="" miscStatusContent="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,invisibleatruntime,alignable,setclientsitefirst">
<progid>MSComctlLib.ImageListCtrl</progid>
</comClass>
<comClass clsid="{F91CAF91-225B-43A7-BB9E-472F991FC402}" tlbid="{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}" threadingModel="Apartment" miscStatus="" miscStatusContent="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,invisibleatruntime,alignable,setclientsitefirst" />
<comClass clsid="{556C2772-F1AD-4DE1-8456-BD6E8F66113B}" tlbid="{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}" threadingModel="Apartment" miscStatus="" miscStatusContent="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,invisibleatruntime,alignable,setclientsitefirst" />
<comClass clsid="{F08DF954-8592-11D1-B16A-00C0F0283628}" tlbid="{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}" progid="MSComctlLib.Slider.2" threadingModel="Apartment" miscStatus="" miscStatusContent="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,setclientsitefirst">
<progid>MSComctlLib.Slider</progid>
</comClass>
<comClass clsid="{0B314611-2C19-4AB4-8513-A6EEA569D3C4}" tlbid="{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}" threadingModel="Apartment" miscStatus="" miscStatusContent="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,setclientsitefirst" />
<comClass clsid="{DD9DA666-8594-11D1-B16A-00C0F0283628}" tlbid="{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}" progid="MSComctlLib.ImageComboCtl.2" threadingModel="Apartment" miscStatus="" miscStatusContent="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,setclientsitefirst">
<progid>MSComctlLib.ImageComboCtl</progid>
</comClass>
<comClass clsid="{87DACC48-F1C5-4AF3-84BA-A2A72C2AB959}" tlbid="{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}" threadingModel="Apartment" miscStatus="" miscStatusContent="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,setclientsitefirst" />
</file>
</assembly>
Next use ManifestCreatorv2.0.3 to create zMSCOMCTL.res file
The Manifest > Create from Project File (vbp) zMSCOMCTL.vbp
The Manifest > Append/Merge Manifest - From file [e.g.: .\manifest\MSCOMCTL.exe.manifest]
The Manifest > Export Manifest >
[_] Indent Manifest
- [_] Do Not Use Prefixed Name Spaces
- [x] Do Not Export Empty/Blank Attributes
- Destination Resource File - save to zMSCOMCTL.res (Replace)
Open VB6 zMSCOMCTL Project or Add zMSCOMCTL.res back into Project
Compile, Build and Test the program.
- Within VB6 zMSCOMCTL Project, start witn full compile: Runs OK
- Within VB6 zMSCOMCTL Project, File -> Make new executable:
- Save Project
Running zMSCOMCTL.exe from with in its Project folder:
`[Run-Error 7 out of memory?]`
Build and use the NSIS file to create the SxS installation file for testing on any target PCs.
The NSIS file builds an executable program to:
- Determine if the target operating system is [AtLeastWinVista] and if it is [RunningX64].
- Request a selection from the available Harddrives / Partitions for installation.
- Based on this criteria, it creates an InstallDirectory and an InstallDirectory\Dependencies subdirectory.
- Copies the Program.exe into the InstallDirectory.
- Copies the Dependency files into the InstallDirectory\Dependencies subdirectory.
- Also based on this criteria it creates a Public read/write data directory.
- Creates desktop shortcut
- Creates start-menu items
- Creates an Uninstall mechanism
I adjusted the NSIS file to install only the dependency files listed in the .vbp file, the UMMM.ini file and in the resulting .exe.manifest file.
Installed on WinXP(32) works OK
Installed on Win7(64) works OK
Installed on Win10(64) works OK
回答1:
Here is the entry from the manifest file from one of the VB6 apps I maintain:
<assemblyIdentity name="name of application" processorArchitecture="X86" type="win32" version="a.b.c.d" />
...
<file name="tabctl32.ocx">
<typelib tlbid="{BDC217C8-ED16-11CD-956C-0000C04E4C0A}" version="1.1" flags="control,hasdiskimage" helpdir="" />
<comClass clsid="{BDC217C5-ED16-11CD-956C-0000C04E4C0A}" tlbid="{BDC217C8-ED16-11CD-956C-0000C04E4C0A}" progid="TabDlg.SSTab.1" threadingModel="Apartment" miscStatus="" miscStatusContent="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,simpleframe,setclientsitefirst">
<progid>TabDlg.SSTab</progid>
</comClass>
<comClass clsid="{942085FD-8AEE-465F-ADD7-5E7AA28F8C14}" tlbid="{BDC217C8-ED16-11CD-956C-0000C04E4C0A}" threadingModel="Apartment" miscStatus="" miscStatusContent="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,simpleframe,setclientsitefirst" />
</file>
generated from OCS version 6.1.98.39 using https://github.com/wqweto/UMMM using a INI configuration file line like so:
File tabctl32.ocx
This is somewhat different from the one in the question:
Has a relative path to the file
Different list of classes
Various different attributes
Hard to say without experimentation how important those differences might be.
I highly recommend logging your program in Process Monitor and seeing what if any errors you get in the log. This is usually how I identify tricky manifest problems.
来源:https://stackoverflow.com/questions/61667173/vb6-regfreecom-autocreate-manifest-for-ocx-file