How to pre-populate the Simple Edits on Reg Dlg? - Advanced Installer Community
kjullion
Posts: 176
Joined: Mon Nov 11, 2013 9:02 pm

How to pre-populate the Simple Edits on Reg Dlg?

Hi,
I have a Registration dialog as part of my testing of an AI project and that works great when the user is interactively using the Setup EXE. It prompts them for three critical pieces of information and stores those key attributes into an INI file.

The problem is that using the "NoGUICommandLineSwitch=/exenoui /qn" flags as part of the Updater process this means that those 3 items cannot be supplied by the user (because there is no UI) and therefore after the updater is done silently installing the system is rendered unusable. Because those 3 attributes are lost (overwritten with blanks)

So my question is: how do I pre-populate the 3 Simple Edit fields that I have on our Registration dialog with the values from our INI file, if those entries exist from a prior installation?

Thanks.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: How to pre-populate the Simple Edits on Reg Dlg?

Hi,

In order to achieve what you want you can use one of the following solutions:
1. You can use the INI Search feature. Just go in the Search page, and use the [ Search ] button to add a new search, then rename that search to the name of the property that you use on your "Registration" dialog (i.e. INI_VALUE1). Right-click on that search and select the "Add Location -> INI file" option.

2. Go in the Install Parameters page and create the properties used on the "Registration" dialog and check the "Set persistent property" option for them. In this case, those properties will be stored in the registry during the first installation and will be taken from there and reused during the upgrade.

Let us know if this helped, otherwise give us more details about your scenario.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
kjullion
Posts: 176
Joined: Mon Nov 11, 2013 9:02 pm

Re: How to pre-populate the Simple Edits on Reg Dlg?

Thanks Eusebiu.

First, I thought I would let you know that in my early experiments that there may be a bug in the Search page when using Copy/Paste.

I have two projects and I used the first one to manually enter the INI Search as you described. Then I right clicked on that Search and chose Copy; opened my 2nd project and went to the Search page and did a right-click and Paste. Everything came over except for the INI File Properties > Path > Folder. I had to manually alter it; it's a minor thing, but I thought it's something you might want to be aware of.

Second, after testing the INI Search I am still not getting the results I was looking for. I am getting no change in behavior in fact, because after the Update is installed the system is unusable because the key values in the INI file are missing after the silent install is complete, so I must not be using the INI Search in the correct way.

I created a search that looks like this:
EDIT_1_COMPANY_NAME
User.ini
Identification
Section: Registration
Key: Company
Field: 0
Type: "Retrieve the raw value from the INI file"
Path
Folder: [Overture_2_Dir]
Depth: 0

Note1: the "Folder" setting resolves correctly to where the INI file is stored on the installed machine, namely: PublicDocumentsFolder\[|Manufacturer]\[|ProductName]
Note2: EDIT_1_COMPANY_NAME is the name of the property bound to the SimpleEdit field on my custome "Registration" dialog

Can you suggest what I might be doing wrong based on the information above?

Thanks.
kjullion
Posts: 176
Joined: Mon Nov 11, 2013 9:02 pm

Re: How to pre-populate the Simple Edits on Reg Dlg?

I can add further observations to my testing of the INI Search feature; however, I am still stuck.

If I change the Folder to a hard-coded path where the INI file resides and I use the Search Test function with the hard-coded path

Code: Select all

  C:\Users\Public\Documents\ProMicro\Overture\
then I get a good result; the INI is read and the Test returns the expected value.

But,shouldn't I be able to use the pre-defined properties, such as:

Code: Select all

 [Overture_2_Dir]
or
 PublicDocumentsFolder\[|Manufacturer]\[|ProductName]
I would like very much to avoid the hard-coded path?

Please advise me on how I can solve this.

Thanks.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: How to pre-populate the Simple Edits on Reg Dlg?

Hi,
I have two projects and I used the first one to manually enter the INI Search as you described. Then I right clicked on that Search and chose Copy; opened my 2nd project and went to the Search page and did a right-click and Paste. Everything came over except for the INI File Properties > Path > Folder. I had to manually alter it; it's a minor thing, but I thought it's something you might want to be aware of.
I tested the scenario and, indeed, this seems to be an Advanced Installer issue. A fix will be available in a future version of Advanced Installer, thank you for bringing it to our attention.
If I change the Folder to a hard-coded path where the INI file resides and I use the Search Test function with the hard-coded path

Code: Select all

C:\Users\Public\Documents\ProMicro\Overture\
then I get a good result; the INI is read and the Test returns the expected value.
Your problem seems to be similar to the one described in the Problem with Search XML: backup some installed file tags thread where you can also find a solution. The only difference is that the INI search is called "AI_AiIniLocator", not "AI_XmlLocator" as described in that thread.

Let us know if this helped.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
kjullion
Posts: 176
Joined: Mon Nov 11, 2013 9:02 pm

Re: How to pre-populate the Simple Edits on Reg Dlg?

Hi,
I am still stuck. I still cannot seem to get passed this problem:
How do I pre-populate the 3 Simple Edit fields that I have on our Registration dialog with the values from our INI file, if those entries already exist from a prior installation?
I am testing AI version 11.2 now and from what I can tell it is still not doing what I expect it to do.
Here is what I'm trying:
I do my initial install of my application I prompt the user for three (simple-edit) Registration values. These values then are stored into our main INI file and is required for the user to run our app.
Next if I do an installation of an updated version of my application the installer should read those 3 values from the INI file and pre-populate the Registration dialog.

I am thinking this must be a common task and I must be doing something wrong...can you please advise me on how to overcome this specific problem?

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

Re: How to pre-populate the Simple Edits on Reg Dlg?

Hello,

For this you can use the first INI Search solution given by my colleague Eusebiu. If this doesn't help you, can you please send us the .AIP (project file) and a verbose log of the upgrade installation to support at advancedinstaller dot com so we can investigate them?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
kjullion
Posts: 176
Joined: Mon Nov 11, 2013 9:02 pm

Re: How to pre-populate the Simple Edits on Reg Dlg?

Hi Dan,
I'm confused. I think the link that you gave me above (INI Search solution) points me directly back to this same thread. So I don't know if that's an accident or you are asking me to re-try something that hasn't worked for me so far. Anyway, I did re-try the suggestions (AI_aiIniLocator) and bumped up those values to 1001. That hasn't seemed to help; my simple-edit values are missing after my update occurs...

I am going to emal you my two main AIP files as well as the Update Config aip file, plus the verbose log from the first full setup. The update process doesn't seem to be creating a log file (or not adhering to my plan to copy into our "my documents" tree). So I will need help on solving that too at some point.

Best regards. And thank you for continuing to help me through these issues I am having.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: How to pre-populate the Simple Edits on Reg Dlg?

Hello Kevin,

You are getting the related behavior because the folder you have set in the "Folder" field of your INI search is not resolved before the "Searches" actions group. Therefore the ini file couldn't be located on its installed location.

Please keep in mind that all custom folders added in "Files and Folders" page are resolved at install time during the "Paths Resolution" actions group, after the "Searches" actions are executed. Only the predefined folder properties are resolved before the "Searches" actions group. This is the default Windows Installer behavior. So, in order to achieve what you want you should set the "Folder" field of your INI search using the Windows Installer predefined folder properties (e.g. [WindowsVolume]My_Folder\MyFolder2).

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
kjullion
Posts: 176
Joined: Mon Nov 11, 2013 9:02 pm

Re: How to pre-populate the Simple Edits on Reg Dlg?

Hi Dan,
Ok, thanks for that, I have tried your suggested fix and it does seem to have solved the problem. Thank you!!

Does implementing your solution mean that I should also revert back my InstallUISequence change? I believe that under Custom Behavior > Table Editor > InstallUISequence > AI_AiIniLocator the value was "99"... and it was suggested that I change it's value to "1001" as one of the attempts to resolve this problem.

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

Re: How to pre-populate the Simple Edits on Reg Dlg?

Hello,
Ok, thanks for that, I have tried your suggested fix and it does seem to have solved the problem. Thank you!!
You're welcome. I'm glad you got this working.
Does implementing your solution mean that I should also revert back my InstallUISequence change? I believe that under Custom Behavior > Table Editor > InstallUISequence > AI_AiIniLocator the value was "99"... and it was suggested that I change it's value to "1001" as one of the attempts to resolve this problem.
Yes, you should also got this working after reverting to our "AI_AiIniLocator" action default value.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: How to pre-populate the Simple Edits on Reg Dlg?

Hello,
I have two projects and I used the first one to manually enter the INI Search as you described. Then I right clicked on that Search and chose Copy; opened my 2nd project and went to the Search page and did a right-click and Paste. Everything came over except for the INI File Properties > Path > Folder. I had to manually alter it; it's a minor thing, but I thought it's something you might want to be aware of.
This was fixed in version 11.3 of Advanced Installer released on June 17th, 2014.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”