GlenT
Posts: 118
Joined: Mon Jul 16, 2012 8:44 pm

Re: COM extraction from .ocx .exe does nothing or is incompl

OK, thanks Daniel. I installed the Beta AI copy under Win7 Pro 32bit and WinXP Pro 32bit on two different machines than what I normally use (to keep my production machines out of it). I uninstalled our software on both and then did the AI extraction.

Generally, the extracted entries appear to be complete under both OS's. There are some variations in the syntax usage [!CSPlus.exe] vs [#CSPlus.exe] vs [APPDIR]\CSPlus.exe between OS's and within each installation. In other other words, sometimes it uses one syntax, and sometimes it uses another, in a couple of cases, seemingly randomly.

Under Win7, under HKEY_CLASSES_ROOT there is one root key entry named TypeLib that is created on the AI Reg page, which is not used. However, under WinXP there is a set (not a complete set) of bogus empty keys that are created (with no data) under HKEY_LOCAL_MACHINE that are superfluous and confusing.

In general, entries under HKEY_CLASSES_ROOT\TypeLib and HKEY_CLASSES_ROOT\Interfaces never appear on the AI Reg page, but do appear on the AI COM page. Not sure is this is 'normal' but again, I've never seen a complete COM project in AI, so I don't know what it is supposed to look like.

There is some data under HelpDir that exists in OUR objects, but which never seems to end up in the either the AI GUI under either page, but did show up under some of the bogus entries in WinXP under HKEY_LOCAL_MACHINE\TypeLib and HKEY_LOCAL_MACHINE\Interface . I can see that path info in the .reg files that I have extracted using the ISX tool, but we may not actually use it in our application.

And none of the Class > File fields on the COM page in either environment are editable (yet) -- not sure if this was supposed to be part of the test or not.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: COM extraction from .ocx .exe does nothing or is incompl

Hello Glen,

Thank you for your feedback. I'll forward your insights regarding the AI 12.1 Beta test results to our development team and hopefully they will be useful for future improvements to our COM extraction mechanism.
And none of the Class > File fields on the COM page in either environment are editable (yet) -- not sure if this was supposed to be part of the test or not.
This wasn't included in the test version of the sent AI. This improvement will be available starting with our next official release version (12.2) of AI. We'll notify you as soon as it will be out.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
codesynergy
Posts: 100
Joined: Fri Nov 14, 2014 10:29 pm

Re: COM extraction from .ocx .exe does nothing or is incompl

To those interested (I hope this is not violating any forum rules):
I've written a python script that will import registry files into your AI project file (into components): https://github.com/codesynergy/AdvancedInstaller
Hopefully, this will be an acceptable work-around for those that need it, until the this functionality is added to AI. Please read the comments at the top before trying to use it. Surely, there will be bugs, so please test thoroughly. Feel free to modify it and re-distribute it as needed.

I also wanted to address a couple points in this thread.

I think there are issues with the proposed regsvr32 custom action solution. I had a service that needed to be registered (the service's file), but the service would not start up, even after running a deferred custom action that ran regsvr32. It almost seemed like, the registry changes were not taking afffect until after InstallFinalize, which comes after the StartServices action. I'm not 100% sure what was going on (I should have documented it when I was doing the testing), but there were issues.
Edit: I just remembered, our files cannot be registered without the VC merge modules, which didn't seem to be installed at the time I was running the regsvr32 custom action.

Regarding the registry syntax...
I'll be honest, I got kind of lost trying to follow what is the correct syntax inside of the AI UI. But, I did come across similar syntax cases in my script (inside of the AI project file). Certain characters had to be escaped, but only in certain fields. But, I want to echo the point that GlenT mentioned. When the feature to import registry files into components is implemented, it should be able to handle the following scenarios:

[HKEY_CLASSES_ROOT\CLSID\{12345678-1234-1234-1234-123456789ABC}\LocalServer32]
@="[APPDIR]MyProgram.exe"

[HKEY_CLASSES_ROOT\CLSID\{12345678-1234-1234-1234-123456789ABC}\LocalServer32]
@="C:\Program Files\MyProduct\MyProgram.exe"


In the first scenario, we have a registry file where the install path of the file has been replaced with an MSI property. You should then be able to import this registry file into AI, and AI will recognize [APPDIR] as an MSI property. So, at runtime, the MSI property will replaced with the value of the property. MSI properties could be anything (not just the install path), but the install path is the most important case. This is the method we currently use with InstallShield, as it is really just a post processing step after the registry file is generated (a regex find and replace).

In the second scenario, we have a registry file with the path hardcoded. You should then be able to import this registry file into AI, and AI will recognize a path exists (regex search). The path should then be replaced with the MSI property that represents the installation directory of the component ([APPDIR] in most cases, but not always).

So, in summary, you should be able to import registry files that contain MSI properties.
Last edited by codesynergy on Thu Jun 11, 2015 5:40 pm, edited 1 time in total.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: COM extraction from .ocx .exe does nothing or is incompl

No, actually contribution is encouraged, thank you for the detailed explanation - I'm sure some future users will find this helpful.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
GlenT
Posts: 118
Joined: Mon Jul 16, 2012 8:44 pm

Re: COM extraction from .ocx .exe does nothing or is incompl

Thanks very much for this CodeSynergy. Your insights are much appreciated.
In the second scenario, we have a registry file with the path hardcoded. You should then be able to import this registry file into AI, and AI will recognize a path exists (regex search). The path should then be replaced with the MSI property that represents the installation directory of the component ([APPDIR] in most cases, but not always).
I agree. I think that this is very important, in order to avoid a lot of potential problems trying to edit these strings manually while wrestling with the AI syntax to figure out what the preferred formulation is.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: COM extraction from .ocx .exe does nothing or is incompl

Hello,

@Glen:
Under Win7, under HKEY_CLASSES_ROOT there is one root key entry named TypeLib that is created on the AI Reg page, which is not used. However, under WinXP there is a set (not a complete set) of bogus empty keys that are created (with no data) under HKEY_LOCAL_MACHINE that are superfluous and confusing.

There is some data under HelpDir that exists in OUR objects, but which never seems to end up in the either the AI GUI under either page, but did show up under some of the bogus entries in WinXP under HKEY_LOCAL_MACHINE\TypeLib and HKEY_LOCAL_MACHINE\Interface . I can see that path info in the .reg files that I have extracted using the ISX tool, but we may not actually use it in our application.
In order to investigate this further can you please send us the test .AIPs (project files) created by you on XP and Windows 7 machines to support at advancedinstaller dot com so we can analyze them? Also, please specify us exactly which are the bogus created registries and which are the missing registries which are not captured.

It would be very useful if you could isolate the behavior in a buildable sample (aip + its referenced files) and send it us alongside a test case which we can follow.

@codesynergy:
In the second scenario, we have a registry file with the path hardcoded. You should then be able to import this registry file into AI, and AI will recognize a path exists (regex search). The path should then be replaced with the MSI property that represents the installation directory of the component ([APPDIR] in most cases, but not always).
This should be our default implementation. If the hardcoded path from REG file matches with the source file (from disk) of one of your added files in "Files and Folders" page, then when importing the REG file the hardcoded path should be replaced with a formatted reference pointing to the install path of the file added in "Files and Folders" page. Did you encounter a different behavior? If so, can you please try to create a buildable sample which replicates the behavior and send it us to support at advancedinstaller dot com so we can test and investigate.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
GlenT
Posts: 118
Joined: Mon Jul 16, 2012 8:44 pm

Re: COM extraction from .ocx .exe does nothing or is incompl

Daniel, I am going to send you a set of files: the two AI projects generated on XP and Win7, the corresponding .reg files that were generated by the InstallShield Express extraction tool. You should be able to cross-reference between them and see what is going on. Note that the 'bogus' entries are easy to identify, as they are in the wrong location (all but one in HKEY_LOCAL_MACHINE) and they have no data associated with them.
codesynergy
Posts: 100
Joined: Fri Nov 14, 2014 10:29 pm

Re: COM extraction from .ocx .exe does nothing or is incomplete

This should be our default implementation. If the hardcoded path from REG file matches with the source file (from disk) of one of your added files in "Files and Folders" page, then when importing the REG file the hardcoded path should be replaced with a formatted reference pointing to the install path of the file added in "Files and Folders" page. Did you encounter a different behavior?
If I remember right, this was indeed the behavior I was seeing. I just wanted to make sure this functionality was carried over to the "import registry file into component" feature.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: COM extraction from .ocx .exe does nothing or is incomplete

Hello,

@Glen:
Daniel, therein lies the problem. Not all of the COM information is reported on the AI Registry page. I see information for the .ocx objects, but not for the .exe objects. For example, it is impossible to edit the COM Class File string [#CSPlus.exe] /Automation because it does not appear under the Registry entries page. It is impossible to add the /Automation option via editing (since you moved that option from the dedicated field that used to exist a few versions back).
An improvement regarding this limitation (the "Class ->File" field of COMs entries is non-editable) was added in our AI 12.2 version released on June 10th, 2015. The "File" field still remained non-editable, but now you can specify the arguments, to be passed to the file specified in the "File" field, in the "Argument" field from "Options" section.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
GlenT
Posts: 118
Joined: Mon Jul 16, 2012 8:44 pm

Re: COM extraction from .ocx .exe does nothing or is incomplete

Daniel wrote:An improvement regarding this limitation (the "Class ->File" field of COMs entries is non-editable) was added in our AI 12.2 version released on June 10th, 2015. The "File" field still remained non-editable, but now you can specify the arguments, to be passed to the file specified in the "File" field, in the "Argument" field from "Options" section.
OK, in other words, you have restored the Argument field that was removed from AI a few versions back. ;)
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: COM extraction from .ocx .exe does nothing or is incomplete

Yes, you are right.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: COM extraction from .ocx .exe does nothing or is incomplete

Hello,
- Add an option to import a registry files into a component. Since you can already import a registry file into a feature, it seems like it wouldn't take too long to implement this.
This improvement has been added in version 12.3 of Advanced Installer released on July 16th, 2015.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
codesynergy
Posts: 100
Joined: Fri Nov 14, 2014 10:29 pm

Re: COM extraction from .ocx .exe does nothing or is incomplete

Hello,

- Add an option to import a registry files into a component. Since you can already import a registry file into a feature, it seems like it wouldn't take too long to implement this.


This improvement has been added in version 12.3 of Advanced Installer released on July 16th, 2015.
Thank you for adding this feature! It seems to be working. I do have a related question. How do I get my paths to turn into [APPDIR] (or any other property)? For example, consider the following registry entry:

Code: Select all

[HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-0000000000000000}\LocalServer32]
@="C:\Program Files\MyFolder\MyFile.exe"
When I import into AI, the entry is added as:

Code: Select all

[ProgramFilesFolder]MyFolder\MyFile.exe
(note, In my installer, I removed the [ProductName] from my [APPDIR])

But, I want it to be:

Code: Select all

[AppDir]\MyFile.exe
So, I think there are two issues here:
- AI is detecting a path and converting it to a property (which is correct), but is there a way to make AI use the [APPDIR] property? I'm guessing it's a syntax issue on my part or something. Obviously, [ProgramFiles] won't work if you changed your installation path during a custom install.
- What is the correct syntax in the registry file to use a property? I tried:

Code: Select all

[HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-0000000000000000}\LocalServer32]
@="[APPDIR]MyFile.exe"
But, AI imports it as:

Code: Select all

[\[]APPDIR[\]]MyFile.exe
... there is an escaping issue here. Like, AI doesn't detect [APPDIR] as a property, but instead as a normal string. I'm fearing the answer is going to be "change after importing", but I'm hoping there is a syntax change I can make in the registry file instead.


Thanks!
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: COM extraction from .ocx .exe does nothing or is incomplete

Hello,
When I import into AI, the entry is added as:
CODE: SELECT ALL
[ProgramFilesFolder]MyFolder\MyFile.exe

(note, In my installer, I removed the [ProductName] from my [APPDIR])

But, I want it to be:
CODE: SELECT ALL
[AppDir]\MyFile.exe
Indeed, this is a limitation of our registry file import support. The converted reg value paths don't use the [APPDIR] formatted reference. An improvement will be available in a future version of Advanced Installer, thank you for bringing this to our attention. We'll notify you as soon as the improvement will be out.
Until then, as a workaround, you should manually edit the imported reg values in the "Registry" page to use the [APPDIR] formatted reference.
- What is the correct syntax in the registry file to use a property? I tried:

CODE: SELECT ALL
[HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-0000000000000000}\LocalServer32]
@="[APPDIR]MyFile.exe"


But, AI imports it as:

CODE: SELECT ALL
[\[]APPDIR[\]]MyFile.exe


... there is an escaping issue here. Like, AI doesn't detect [APPDIR] as a property, but instead as a normal string. I'm fearing the answer is going to be "change after importing", but I'm hoping there is a syntax change I can make in the registry file instead
I'm afraid this is not possible. All formatted characters (i.e. [, ]) will be escaped as you saw and you cannot use a property reference in your reg file.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
codesynergy
Posts: 100
Joined: Fri Nov 14, 2014 10:29 pm

Re: COM extraction from .ocx .exe does nothing or is incomplete

Indeed, this is a limitation of our registry file import support. The converted reg value paths don't use the [APPDIR] formatted reference. An improvement will be available in a future version of Advanced Installer, thank you for bringing this to our attention. We'll notify you as soon as the improvement will be out.
Until then, as a workaround, you should manually edit the imported reg values in the "Registry" page to use the [APPDIR] formatted reference.
That would be great. Also note, that there could be other folder properties other than [APPDIR]. For example, I might define a directory "MyFolder_Dir" as "C:\MyFolder". Currently, this will result in [WindowsVolume]MyFolder, instead of [MyFolder_Dir]MyFolder.
I'm afraid this is not possible. All formatted characters (i.e. [, ]) will be escaped as you saw and you cannot use a property reference in your reg file.
Ok, that's what I kind of figured.

I would like to suggest two additional related features for the future:
- The ability to put AI properties in a registry file. Maybe some special syntax to sidestep the character escaping
- The ability to import the registry files into components at build time (dynamic). I might have mentioned this one before.

Basically, the goal being to eventually match InstallShield's "Reg File To Merge At Build" feature, which dynamically adds registry files to components and allows properties in the registry file. This basically allows a user to generate registry files using outside scripts/applications/com extraction tools, then plug them into AI. I'm going to guess I'm the only user who has requested this feature, so it's probably not a high priority thing, but maybe something to think about in the future.

Again, thanks for adding the import-into-component feature!

Return to “Common Problems”