views:

1270

answers:

4

I've attempted to use the EstimatedSize value during creation of an uninstaller registry key for an app I've developed, unfortunately the value I specify does not appear in the Add/Remove Program list next to my program's entry. I've tried to find the proper procedure for using this value but to no avail. Anyone have any experience on this issue? Your help would be appreciated.

Divo got me on the right track so I figured I'd post step-by-step instructions on how to correctly display the EstimatedSize value.

  1. Create the registry key with all relevant properties, including EstimatedSize. This value will be replicated in the ARPCache key in the registry
  2. Find the registry key inside the ARPCache folder, delete the SlowInfoCache binary value, and set the Changed value to 1.
  3. Next time the Add/Remove Programs list is opened you will see the value you specified in the EstimatedSize entry, not the arbitrary Windows generated one.
A: 

What kind of installer did you use? MSI?

Windows Installer will determine and set this value during installation (see MSDN: Uninstall Registry Key)

I think it is not possible to manually set this value. There is a lot going on (some really "lame" stuff) behind the scenes (http://blogs.msdn.com/oldnewthing/archive/2004/07/09/178342.aspx)

Regards, divo

0xA3
+1  A: 

Hi again,

I figured out that changing the value of EstimatedSize under

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{my-guid-value}

does not have any direct effect. This value is cached in the following key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Management\ARPCache\{my-guid-value}\SlowInfoCache

Only after I remove (rename) this SlowInfoCache value, the updated size appears under Add or remove programs.

Regards, divo

0xA3
A: 

Hi, thanks for this trick. But this seems to no longer work on Windows 7. There is no ARPCache key in registry any more. But after experimenting I realized that we can edit EstimatedSize property and this will reflects in Add Remove Programs immediately. Do somebody else see the same?

Thanks, LaHope

LaHope
A: 

Writing an arbitrary value works fine for me on Windows7.

I use NSIS which does not automatically fill this value or write this key or do anything magical here. But you can create the registry keys yourself, and put whatever you want in them yourself, using ordinary script commands.

This is NSIS *.nsi script, sorry, but there's only 3 active lines. I don't think you have to know NSIS to see that I'm just creating the key arbitrarily and writing a value of my choice into it. I can tell you also that, when I was putting bad values in there, it sure showed up in add/remove programs exactly as bad as what I'd written. (I assumed the value was supposed to in Bytes at first, So, my 3.2 MB app showed up as 3.2 GB)

excerpt from foo.nsi :

    [...]

    ; ARP = just convenience variable to hold the long reg key path
    !define ARP "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}"

    ; include a function library that includes a file/directory size reporting command
    !include "FileFunc.nsh"   ; for ${GetSize} for EstimatedSize registry entry

    [...]

    Section "Install"

    ; [...copy all files here, before GetSize...]

    ; get cumulative size of all files in and under install dir
    ; report the total in KB (decimal)
    ; place the answer into $0  ($1 and $2 get other info we don't care about)
    ${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2

    ; Convert the decimal KB value in $0 to DWORD
    ; put it right back into $0
    IntFmt $0 "0x%08X" $0

    ; Create/Write the reg key with the dword value
    WriteRegDWORD HKLM "${ARP}" "EstimatedSize" "$0"

    [...write the other keys in the same reg path...]

    SectionEnd

    [...]