Memory prerequisite - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

yishai
Posts: 54
Joined: Wed Nov 23, 2005 11:54 pm

Memory prerequisite

is there a way to do the following:

1. Set the Memory prerequisite value from a variable (i.e.[RAM]) vs. a fixed number from the dialog. (the reason is that I build my packages from the command line and I need to allow some builds to be different than others).

2. have this Memory prerequisite be a recommendation only, i.e. warn the user but still work? Not sure if this qualifies as a prerequisite...

3. If not, can you think on a way I can give the user a memory warning during the installation when I think he needs it?

Using AA 6.9.1 enterprise. Its a Java project.

Thanks

-Yishai
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Memory prerequisite

Hi,
1. Set the Memory prerequisite value from a variable (i.e.[RAM]) vs. a fixed number from the dialog. (the reason is that I build my packages from the command line and I need to allow some builds to be different than others).
the AI_MINRAM property is the one you are looking for. This property needs to be set under the InstallUISequence, before the Launch Condition Standard Action is executed. This means you can not set it using the install wizard. It would have to be set by a custom action. The custom action could read it from an external file or other source.
2. have this Memory prerequisite be a recommendation only, i.e. warn the user but still work? Not sure if this qualifies as a prerequisite...
For this, you would have to not use the Minimum Physical Memory Launch Condition. You would need to create your own custom action that does the memory check and display a warning message
3. If not, can you think on a way I can give the user a memory warning during the installation when I think he needs it?
You can only achieve this using a custom action. The GlobalMemoryStatus API can help you do this.

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
yishai
Posts: 54
Joined: Wed Nov 23, 2005 11:54 pm

Re: Memory prerequisite

Thanks.

Making progress. here is what I did.

1. defined a Property RAM with a value of 256.

2. Created a LaunchCondition custom action under InstallUISequance. This custom action is defined as
PhysicalMemory < RAM (and I also tried PhysicalMemory <= "RAM").
I would expect, given your notmal sytax, it to be something like [PhysicalMemory] <= [RAM]. Anyway, this does not seem to work (see #3), so, what is the systax here? How can I use a property? Does it have to be AI_MINRAM?

3. I did add under the launch condition another cutomr action for an ErrorMessage. This does show wllawys. (the message is
Not Enough Memeory = [PhysicalMemory] MB (RAM=[RAM] MB)
and the values are corect (i.e it shows as Not Enough Memeory = 3665 MB (RAM=256 MB))
I don't know if this is because the condition syntax is wrong or what. Any ideas would be helpful.

4. The installation aborts after the errorMessage. This is consistent with the documentation. However, i did not find a custom warningMessage. Anyway to shoe the error but not abort?

Thanks

-Yishai
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Memory prerequisite

Hello Yishai,

You only need one Script Inline Custom Action. Set the Script Text field to:

Code: Select all

MsgBox("Warning: Not Enough Memory . It is recommended that the system has a minimum of [RAM] MB memory.")
and the execution condition to:

Code: Select all

NOT Installed AND ( PhysicalMemory < RAM )
On the Install Parameters page, set your RAM property to whatever quantity of RAM is needed.

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
yishai
Posts: 54
Joined: Wed Nov 23, 2005 11:54 pm

Re: Memory prerequisite

Hi Gabriel

Code: Select all

MsgBox("Warning: Not Enough Memory . It is recommended that the system has a minimum of [RAM] MB memory.")
This partialy works. it does the warning vs. the error and does not quit, so this part is done. However, the message comes out as:
" ...has a minimum of [RAM] MB memory..." vs. " ...has a minimum of 256 MB memory..."
so [RAM] is not identified as the variable it is. If I go the the action data filed, and click the "edit custom action parameters" I can see that RAM is a valid property with a value. Is there a syntax or scope issue here?

Code: Select all

NOT Installed AND ( PhysicalMemory < RAM )
This has similar problem. i get to the warning always, even when i clearly have more than 256 MB. Again, is it syntax? scope? Any ideas how I can verify it? As a point of refrence, I get to the same place even when my condition is

Code: Select all

NOT Installed AND ( PhysicalMemory < 256 )
oe even when it is

Code: Select all

NOT Installed AND ( PhysicalMemory > 256 )
Any ideas?

Thanks

-Yishai
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Memory prerequisite

Hello Yishai,

Oops, sorry about that. It appears the Script Text field does not support formatted text. You could try this:

Code: Select all

MsgBox("Warning: Not Enough Memory . It is recommended that the system has a minimum of "&CStr(Session.Property("RAM"))&" MB memory.")
As for the condition, it should work, as I have tested it on my machine. Just make sure you have defined the RAM property on the Install Parameters page.

Also make sure that the Script Inline custom action is placed in the InstallUISequence under the FindRelatedProducts standard action.

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
yishai
Posts: 54
Joined: Wed Nov 23, 2005 11:54 pm

Re: Memory prerequisite

The waring works, but the condition drives me crazy....

I created , under the InstallUISequnce a FindRelatedProduct action, and in it the ScriptInline.

It will always get to the warning dialog, regardless what is the condition. To make it simple, I tried onc with the condition

Code: Select all

PhysicalMemory = PhysicalMemory
and than with the condition

Code: Select all

PhysicalMemory <> PhysicalMemory
In either case, I get into the script.

So, either the condition is not interpreted correctly, or the warning in not set/defined in the right place so it happens regardless of the condition. I think I did it correctly, but can you give the detailed steps of creating this action+warning sequence I can follow and make sure it is set right? Why is it important for it to be in the FindRelatedProducts action? Why not in the Begin or any other action? Can that be related?

Thanks

-Yishai
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Memory prerequisite

Hello,

Did you set the RAM property from the Install Parameters page?
The conditions you are using are not correct. Make sure the RAM property is set, then use the condition:

Code: Select all

NOT Installed AND ( PhysicalMemory < RAM )
as stated in my previous post.

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
yishai
Posts: 54
Joined: Wed Nov 23, 2005 11:54 pm

Re: Memory prerequisite

HI Gabriel

Yes, I have set it exactly like that,

Code: Select all

NOT Installed AND ( PhysicalMemory < RAM )
but when it did not work i tried to play with it, so I tried making it

Code: Select all

NOT Installed AND ( PhysicalMemory < 256 )
and when this did not work I tried to set it to something that will be obvious true or false, like

Code: Select all

PhysicalMemory = PhysicalMemory
and

Code: Select all

PhysicalMemory <> PhysicalMemory
where one must be true and the other one must be false. However, it ALWAYS goes to the warning script, which brings me the suspicion it is not about the variables / condition but something else, maybe the script definition that causes it to get into it regardless of if the condition is true or false. In other words, I don't manage to get a condition that will work, so it is either the way the condition is interpreted to always return FALSE, or the way the "action" is handled, to always perform the script regardless of the condition result.
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Memory prerequisite

Hi,

Please send your .aip project file (or a stripped down version that accurately reproduces this behavior) to support at advancedinstaller dot com so we can further investigate this issue.

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Memory prerequisite

Hello,

Please note that you have placed the condition in the wrong place.
- select your custom action
- in the right pane, lower to where you set your warning message there is a section "Execution Condition", place your condition there.

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
yishai
Posts: 54
Joined: Wed Nov 23, 2005 11:54 pm

Re: Memory prerequisite

That worked, thanks. You must admit the double location of the condition is somewhat confusing...

Anyway, thanks for your great help and this great product.

-Yishai

Return to “Common Problems”