EstimatedSize - 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!

stevejonesuk
Posts: 16
Joined: Mon Aug 10, 2009 11:43 am

EstimatedSize

Hi, I'm using a project with the "do not show in list" option checked on the Product Details page, so I have to supply my own information to appear under Programs And Features. As part of this, I need to display the installation version number and size. I've implemented the version fine using [ProductVersion] as the value for HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\Our Product\DisplayVersion. I can inform Windows of the size using a DWORD value called EstimatedSize under the same key, but what I don't know is how to generate the value itself, and so I'm having to use a hardcoded value. I tried ARPSIZE, but at installation time I got a "cannot write to registry"-type error, so I'm assuming it's the wrong variable type (or just completely unsuitable).
Is there a better way of doing it? Thanks.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: EstimatedSize

Hi,

Unfortunately Windows has a lot of limitations when it comes to manually populating the "Programs and Features" applet. When showing your product in the list, the size is calculated and written automatically by Windows Installer.

Since you want to write it manually, I was going to recommend using the ARPSIZE property. Note that this registry entry should be created at the end of installation, after the "InstallExecuteSequence" -> "PublishProduct" action. Using the "Registry" page will make the installer create the entry too early (most likely this is why you received the error), so a solution is to use a custom action (for example custom code or the reg command).

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
stevejonesuk
Posts: 16
Joined: Mon Aug 10, 2009 11:43 am

Re: EstimatedSize

Sounds good. Excuse my ignorance, but how would either a batch file read the [ARPSIZE] property, or a Visual Basic (say) script write to the registry? I can see the "reg" command-line command on MSDN but I'm assuming I can't simply use it directly in a Visual Basic script. You couldn't write a short example, could you? Thanks.
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: EstimatedSize

Hello,

You would use the reg command line directly as a custom action. For example, you could use a Launch File or Open URL custom action, and you would put reg along with its parameters. This will launch the reg utility with its corresponding parameters.

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
stevejonesuk
Posts: 16
Joined: Mon Aug 10, 2009 11:43 am

Re: EstimatedSize

Hi again,
I've got the "run file"-type custom action working OK if I use a hardcoded value for the data, but if I insert a reference to the [ARPSIZE] Windows Installer Property, it doesn't write anything at all under EstimatedSize in the registry.
This is the same whether I run at the stage "Commit\PublishProduct" or "Commit\InstallFinalise". I've checked Windows Event Viewer, but it just says that the installation succeeded instead of giving any interesting error description.

Command line:
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MyProduct" /v EstimatedSize /t REG_DWORD /d 767676
= success.
Command line:
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MyProduct" /v EstimatedSize /t REG_DWORD /d [ARPSIZE]
= nothing written.

Any ideas?
Thanks,
- Steve.
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: EstimatedSize

Hello,

The ARPSIZE property is not populated by Windows Installer. This property exists for you to fill, so you can override the displayed size in the Add/Remove Programs utility. You could do either of the following:
- install your application, look at the size, then hardcode the aproximate size in your installer.
- create a custom action in the language of your choice to compute the size of your installed application, then store it in ARPSIZE
- leave ARPSIZE empty and let the Add/Remove Programs utility handle the size computation

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”