Click here to Skip to main content
15,890,717 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to calculate the size of feature DLLs(dll+exe+xml) in installshield project to set the size into the programms and feature in control panel.
code is..

function OnEnd()
STRING szInstallLocation,str;
NUMBER nsize1,nsize2;
begin
szInstallLocation=szSDKDirectory;
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
nsize=FeatureTotalSize(MEDIA,"DLLs",TRUE,TRUE);
nsize=(nsize/1024);
NumToStr(str,nsize);
RegDBSetKeyValueEx("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall" ^PRODUCT_GUID, "EstimatedSize", REGDB_NUMBER, str, -1);
end;

On Win7 it is correct(size=17.2mb) but on WinXP it wrong(size=1001mb).
please help me!
Posted
Updated 24-Oct-11 21:38pm
v8
Comments
OriginalGriff 19-Oct-11 9:10am    
Please do not just post a new question because you have not had an answer - use the "Improve question" widget to provide better information instead. I have deleted your older version.
OriginalGriff 19-Oct-11 9:12am    
I have deleted both of your earlier versions!
Richard MacCutchan 19-Oct-11 9:35am    
What error; you have just posted two file paths?

1 solution

This doesn't work for you
C#
RegDBSetKeyValueEx("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall" ^PRODUCT_GUID, "EstimatedSize", REGDB_NUMBER, "nsize", -1);

No wonder nsize is the value you wish to write to the registry key, but you're writing the string "nsize" to the registry key.
You have to convert nsize to a string and then use that string.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900