Zsolt Kollarits
Posts: 342
Joined: Fri May 29, 2015 10:36 am

Registry based search has incorrect value

Dear Advanced Installer Support Team,

Could you please take a look at the .aip that I will send over to you via mail and search for KOFAX_POWER_PDF_PATH?

You will see that we have a registry based search in the "Search" area, based on a regkey we are trying to find out whether an external tool is installed, and we save the value to KOFAX_POWER_PDF_PATH. We would expect that if the regkey is not found, then the property remains empty.

Our task is the following:
1. If the property is NOT empty, so that the external tool is installed on that particular PC, then we modify a file under KOFAX_POWER_PDF_PATH location. For more info see the Files and Folders area.
2. This should happen only if the property is NOT empty, so that I set KOFAX_POWER_PDF_PATH as a condition for the relevant component in the Organization tab. Please check the Therefore Integrate/Power PDF/UILayout component which contains the file that we would like to modify.

Problem:
Somehow the KOFAX_POWER_PDF_PATH property gets a default value, EVEN IF the relevant regkey in the search is missing from the PC. Please take a look at the installation logfile that I will also send you. The default value is "C:\KOFAX_POWER_PDF_PATH" somehow, that's something we do not understand.

Could you please help us to achieve what we would like?

Best regard,
Zsolt
Catalin
Posts: 6586
Joined: Wed Jun 13, 2018 7:49 am

Re: Registry based search has incorrect value

Hello Zsolt,

Normally, the property should indeed remain empty if the search fails.

However, in your case, you have created a property based folder with the exact same name as the search.

During the "CostFinalize" standard action:
ends the disk space costing and resolves the folders in the project
the folders are resolved. In your case, since the property is empty, it defaults to the name of the property (which happens to be the name of your search as well).

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Zsolt Kollarits
Posts: 342
Joined: Fri May 29, 2015 10:36 am

Re: Registry based search has incorrect value

Dear Catalin,

Could you please tell me how I could achieve the following:
1. We check with a search whether Kofax is installed on the PC. If so, then the search's property should contain the path of the Kofax toolkit
2. We would like to modify the following xml file: KOFAX_INSTALL_DIR\Resource\PowerPDF\UILayout\Publish Mode.xml, that's the reason we added that part into the Files and Folders area. Of course we just would like to modify the file when the Kofax is installed (step 1).

Thanks in advance for your help.

Best regards,
Zsolt
Catalin
Posts: 6586
Joined: Wed Jun 13, 2018 7:49 am

Re: Registry based search has incorrect value

Hello Zsolt,
Problem:
Somehow the KOFAX_POWER_PDF_PATH property gets a default value, EVEN IF the relevant regkey in the search is missing from the PC. Please take a look at the installation logfile that I will also send you. The default value is "C:\KOFAX_POWER_PDF_PATH" somehow, that's something we do not understand.
I'm assuming the problem here is the fact that the folder is created on the user's machine, even if the search fails (please correct me if I'm wrong).

In that case, you could try conditioning the creation of your folder (by conditioning the component) so it is not created upon install if the search fails.

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Zsolt Kollarits
Posts: 342
Joined: Fri May 29, 2015 10:36 am

Re: Registry based search has incorrect value

Dear Catalin,

"In that case, you could try conditioning the creation of your folder" -> this is exactly what we tried to achieve. If you open up the .aip I sent you with my last email, I set a condition (see the attached image).

So basically if I search for "KOFAX_POWER_PDF_PATH" text in our .aip project, there is only one component found in the search result list: "UILayout" component -> for that one we set a condition, but it seems something is still wrong.

Could you please take a look at our .aip as well as the attached image?

Thank you :)

Best regards,
Zsolt
Attachments
ForAI2.png
ForAI2.png (32.99 KiB) Viewed 10552 times
Catalin
Posts: 6586
Joined: Wed Jun 13, 2018 7:49 am

Re: Registry based search has incorrect value

Hello Zsolt,

As it looks like from your project and the screenshot, you have conditioned a subfolder of the property based folder - thus me saying you should condition the property based one.

In your project specifically, I see that no component is assigned to the property based folder - the "Go to Component" option is greyed out.

In a newly created project, I have noticed that a component is created for the property based folder, which makes me think that you manually modified something afterwards.

With that being said, could you please try recreating the folder and conditioning the component assigned to the property based folder (not one of its subfolders)?

Hope this helps! :)

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Zsolt Kollarits
Posts: 342
Joined: Fri May 29, 2015 10:36 am

Re: Registry based search has incorrect value

Dear Catalin,

I tried to do what you proposed, but it's not really doable. Please take a look at the screenshots I'm attaching. I did the following:

1. Navigated to "Files and Folders" and clicked on Target Computer
2. Clicked on New Folder on the ribbon on selected Property Based
3. I selected the relevant KOFAX property -> folder really has been created, with a separate component, so I could set an individual condition for that condition as per your proposed
4. I started to add subfolders under KOFAX_POWER_PDF_PATH folder, so I added the necessary "Resource/PowerPDF/UILayout" chain
5. The problem at this point is that if you go back to component, you will see that the component's name was changed to UILayout and I can set a condition for that one, but you said it's not the correct approach

How would you do that? Could you please define the steps for me? It would be highly appreciated. :)

Best regards,
Zsolt
Catalin
Posts: 6586
Joined: Wed Jun 13, 2018 7:49 am

Re: Registry based search has incorrect value

Hello Zsolt,

You are indeed right about that, I tested it just now and can confirm the behavior.

In that case, after further testing, here's how I would proceed:

- first of all, we need to gather all the subfolders and files components and move them under a single feature, e.g.:
Screenshot_21.png
Screenshot_21.png (77.99 KiB) Viewed 10077 times
Screenshot_22.png
Screenshot_22.png (31.54 KiB) Viewed 10077 times
- we can then condition the feature, by setting its install state to "Not installed" and "Installed if" - our condition
Screenshot_23.png
Screenshot_23.png (7.07 KiB) Viewed 10077 times

Or you can also leave it like "Installed" by default and "Not installed if" - NOT YOUR_PROPERTY

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Zsolt Kollarits
Posts: 342
Joined: Fri May 29, 2015 10:36 am

Re: Registry based search has incorrect value

Dear Catalin,

I will send 2 logfiles for you, basically I modified our project as per you asked me, but our property still gets this default value: "C:\KOFAX_POWER_PDF_PATH\" (please take a look at the "log_noPowerPDFInstaller.log" file.

So basically we would like to achieve the following:

Scenario 1:
1. Kofax toolkit is installed on the PC, so there is a "Publish Mode.xml" under this location: "C:\Program Files (x86)\Kofax\Power PDF 41\Resource\PowerPDF\UILayout"
2. So our installer should read out (Search) the path of "C:\Program Files (x86)\Kofax\Power PDF 41" from HKEY_LOCAL_MACHINE\SOFTWARE\Kofax\PDF\InstallPath
3. Based on that property, the XML should be found, and the relevant XML nodes have to be replaced as per you can see in our .aip in "Files and Folders" area

Scenario 2:
1. Kofax toolkit is NOT installed on the PC
2. Our installer should try to read out the Kofax path, but obviously no regkey is found
3. Out installer is NOT creating random folders neither under C: nor under our 64-bit install directory

Could you please create a small .aip for us that successfully completes both scenarios? I'm also sending over the Publish Mode.xml file too, so that you can play though the exact same scenarios?

It would be highly appreciated as no matter how I modify our .aip, I can never achieve a fully-working solution.

Thanks in advance. :)

Best regards,
Zsolt
Catalin
Posts: 6586
Joined: Wed Jun 13, 2018 7:49 am

Re: Registry based search has incorrect value

Hello Zsolt,

I've been thinking that perhaps we should give a default value for the property that stores your search result.

Of course, so it does not give an error, this should be a valid path, such as C:\. This way, if the search fails, the property has a default value and therefore the folder will not be created on disk.

Our main issue here is the fact that the property basically does not exist and during the "CostFinalize" standard action, the folders from your project are resolved and since it has no value, it basically takes as value the name of the property.

In order to programatically achieve this (because some users may not have the C:\) path, we can use a "Set property" custom action, scheduled before the "Search" action group that will set your property to something like [WindowsVolume] (this will be C:\ on most machines).

Could you please try the above and let me know if it helps?

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Zsolt Kollarits
Posts: 342
Joined: Fri May 29, 2015 10:36 am

Re: Registry based search has incorrect value

Dear Catalin,

I modified our .aip based on your last suggestions, created an EXE file and installed on 2 different virtual machines - one machine had "Publish Mode.xml" file under the "C:\Program Files (x86)\Kofax\Power PDF 41\Resource\PowerPDF\UILayout" location, the other machine doesn't.

- there are no extra KOFAX_POWER_PDF_PATH folders were created on the "empty" machine -> this is the expected behavior
- however on the other machine, the Publish Mode.xml file was not touched, so the relevant nodes/section was not replaced -> that is a problem, previously it was working

If you could send us a small sample .aip where both of the scenarios are working, that would be highly appreciated. Or any further suggestions woudl be also appreciated, I can also perform some more tests. :)

Could you please take a look at our latest .aip that I will send over via email? Thank you :) Also I will send over the logfiles of the 2 installations that I performed.

Best regards,
Zsolt
Catalin
Posts: 6586
Joined: Wed Jun 13, 2018 7:49 am

Re: Registry based search has incorrect value

Hello Zsolt,

This doesn't work because you have scheduled your custom action under the "Install Execution Stage"

Basically the search is executed first in "Wizard Dialogs Stage" and then you overwrite it in the "Install Execution Stage". Additionally, the search is no longer executed in the "Install Execution Stage" so basically your setup tries to execute the file operation in the C:\ directory where the files does not exist.

What you can do, to cover both full UI and silent installations, is:

- shift + drag and drop your custom action from "Install Execution Stage" to "Wizard Dialogs Stage"

- you can then click on the SetProperty custom action from under the "Installed Execution Stage" --> click "Advanced execution scenarios..." --> "Skip action in Install Execution Stage if executed in Dialogs Stage"
Screenshot_6.png
Screenshot_6.png (49.87 KiB) Viewed 9671 times

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Zsolt Kollarits
Posts: 342
Joined: Fri May 29, 2015 10:36 am

Re: Registry based search has incorrect value

Dear Catalin,

The solution you proposed seems to be working, thanks for the help. I will test it a little bit further, but it seems it's working now :)

Best regards,
Zsolt
Catalin
Posts: 6586
Joined: Wed Jun 13, 2018 7:49 am

Re: Registry based search has incorrect value

You are always welcome, Zsolt!

I am happy to hear that the solution is working. :)

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”