tdico
Posts: 3
Joined: Mon Nov 21, 2022 10:05 pm

Property not persisted after reboot, restart install

Mon Nov 21, 2022 10:42 pm

I have a few pre-install prerequisites defined.
I also have a custom dialog that is part of the Pre-install UI.
That dialog gets a path from the user and sets a public property to the value.
When a particular pre-install package is run, its command line accesses that property.

The first pre-requisite package to be run is .net, for which I have 'reboot system after installing...' checked.

When I run my setup, the custom dialog is displayed, and the user's input is set in the property correctly.

When the packages start installing, .net is first, and the reboot occurs as expected.

On logging back into the machine post reboot, the setup resumes installing the other pre-requisites.

The problem is: the value of that property appears to be missing, and the pre-requisite package that expects it isn't properly executed.

Is there a way to persist the current properties of a setup so that they get applied when it starts back up post reboot?

Note: I'm using AI 19.0

Catalin
Posts: 6541
Joined: Wed Jun 13, 2018 7:49 am

Re: Property not persisted after reboot, restart install

Wed Nov 23, 2022 1:54 pm

Hello and welcome to our forums,

I'm afraid that might not be possible.

Most likely, to workaround this, you would need to:

- get the input from the user

- create a Custom Action that writes the value of that property to the registry/some other place from where you can then take its value

- on the "Next" button from that dialog, schedule the Custom Action

Then, in your prerequisite, you could create a search for that registry entry and retrieve the value.

Note: in order to write to the registries at that point in time, you might need to launch your EXE setup elevated, so the "Run as administrator" option from the "Install Parameters" page might need to be checked.

Hope this helps!

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

tdico
Posts: 3
Joined: Mon Nov 21, 2022 10:05 pm

Re: Property not persisted after reboot, restart install

Wed Nov 30, 2022 5:37 pm

I can see how that could work - up until the search you mentioned.

I don't see where I would add a search to the pre-requisite. Is that something available after 19.0?

Do you mean adding an install condition?

Thanks,
Tom

Catalin
Posts: 6541
Joined: Wed Jun 13, 2018 7:49 am

Re: Property not persisted after reboot, restart install

Tue Dec 06, 2022 4:38 pm

Hello Tom,

I might have misunderstood your request here, so please ignore my last reply. Let's try to review this one more time.

So you have a package that has multiple pre-install prerequisites.

Before installing the prerequisites, you get a path from the user through the dialogs and then store that in a property. After the first prerequisite is installed, the system is restarted and the value of your property (the path) is no longer there? Is this correct?
The problem is: the value of that property appears to be missing, and the pre-requisite package that expects it isn't properly executed.
My questions is, how did you figure the property's value is not persisted?

Do you pass this property through the command line to your pre-install prerequisite, something like this:
Screenshot_30.png
Screenshot_30.png (2.73KiB)Viewed 3666 times

As you can see, that field is not formatted for pre-install prerequisites, meaning that you can not refer a property there.

In order for me to further assist here, please give me some more details about how exactly you want to use this property in your prerequisite.

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

tdico
Posts: 3
Joined: Mon Nov 21, 2022 10:05 pm

Re: Property not persisted after reboot, restart install

Tue Dec 06, 2022 5:29 pm

Yes, you understand correctly the behavior we are seeing.

And Yes - that is how we are using the property - within the Install Command Lines.

The property we store is a path for where that pre-req should be installed.

Upon restart and upon executing that pre-req installer, it is installed at the current path, since the value is empty.

If I turn off the forced restart, the pre-req installer uses the property and is installed to the correct path.

Tom

Catalin
Posts: 6541
Joined: Wed Jun 13, 2018 7:49 am

Re: Property not persisted after reboot, restart install

Thu Dec 08, 2022 1:10 pm

Hello Tom,

You are indeed right about this.

I have run some tests and I could indeed confirm the behavior.

I have now opened a ticket in our bug tracking tool and hopefully this will be fixed in a future version of Advanced Installer.

Until then, I'm afraid the only workaround I can think of would be simply rescheduling your prerequisites, e.g. place prereq2 before prereq1 so it can get the path. This is, of course, viable only if prereq2 does not rely on prereq1 to be installed.

Besides this, I'm afraid I have tried some more solutions, but none worked. :(

I will continue to run a few more tests and if I find anything I'll make sure to followup here to share the solution with you.

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

Return to “Common Problems”