
trucqlp1.5524930867819158E12 asked a question.
How to set path for public properties in InstallScript MSI project.
Hi all, I'm working on a InstallScript MSI project. I want to set path for some public properties. Ex: Properties "ProgramFilesFolder" have default value: ProgramFilesFolder = C:\ProgramFiles. I want to set new value for this property: ProgramFilesFolder = C:\abc. So I do: FeatureSetTarget(MEDIA, "", "C:\\abc"); MessageBox("ProgramFilesFolder = " + ProgramFilesFolder , INFORMATION); But after that I see the result: ProgramFilesFolder = C:\ProgramFiles. That means I can't set new path for ProgramFilesFolder property. But with "INSTALLDIR" property: Default value: INSTALLDIR = C:\WINDOWS\system32. After I do: FeatureSetTarget(MEDIA, "", "C:\\abc"); MessageBox("INSTALLDIR= " + INSTALLDIR, INFORMATION); The result is: INSTALLDIR = C:\abc. I wonder: Can't "FeatureSetTarget" function set new path for public properties ? (ProgramFilesFolder, CommonAppDataFolder...). If it can't, why I can set new path for "INSTALLDIR" property ? I'm so confused >" Pls help me if u can.. I'm appreciated.
Thanks u so much for ur response :) .
But when I looked up in Directory Table (Additional Tools/Direct Editor), I saw [ProgramFilesFolder] property have Directory_Parent is "TARGETDIR", and [INSTALLDIR] property have Directory_Parent is "SystemFolder" (In my others InstallScript MSI project, [INSTALLDIR] property have Directory_Parent is "ISMyProductDir" or "My_Product_Name"...).
That means [ProgramFilesFolder] isn't a System Folder Property, is it ? And how can I set new path for this property ?
Pls suggest ur idea.
I'm appreciated.
MSDN snippet:
Custom actions that change one of the System Folder Properties should be included in both the execution sequence tables (InstallExecuteSequence Table or AdminExecuteSequence Table), and the user interface sequence tables (InstallUISequence Table and AdminUISequence Table) so that the folder is changed during both full UI and basic UI installations.
Thanks u again for ur answer. I'm appreciated.
I want to ask sth. As ur suggestion, I defined a new component and used my own property follow this description (http://kb.flexerasoftware.com/selfservice/microsites/search.do?cmd=displayKC&docType=kc&externalId=Q104964&sliceId=) .
It worked fine. After I run my program, I can set path for my property. Due to that, I can have InstallShield copy folders and files into my property.
But the size of my product in Add/Remove Program Files (Control Panel) isn't correct. Perhaps it's the size of the folders and files in public properties ([INSTALLDIR]...), not include the size of the folders and files of my property.
How can I control the size of my product in Control Panel ?
And perhaps If I can't find the method to control the size of my product in Control Panel (include the size of the folders and files in my own properties), I ought to come back to my first way as I ask u above: How can I set path for InstallShield's properties ? ([ProgramFilesFolder], [CommonAppDataFolder]...). ( I tried to insert CA as u suggest above and similar this link (http://kb.flexerasoftware.com/selfservice/microsites/search.do?cmd=displayKC&docType=kc&externalId=Q105723&sliceId= ) but it's still not work ). Cauz I think when I add folders, files into these properties, InstallShield can control the size of my product in Control Panel.
Pls help me. It's urgent.
And ur suggestion's very useful for me. Can I have ur e-mail to ask about many others aspects of InstallShield ?
Regards.
Try overwrite the key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{PRODUCTGUID}
Keyname - > EstimatedSize(DWORD) Value -> Your size in hexadecimal.
Install creates this key automatically, try to overwrite the key after the publish product…
i didnt find time today. i will work this out tomorrow and let you know.
OK. I tried this. It is working for me.
As I said above, create a custom action to create a registry, call the custom action at last.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{PRODUCTGUID}
Keyname - > EstimatedSize(DWORD) Value -> Actual SIZE (no need hexadecimal).
I did as ur method. I set value for "EstimatedSize" key. It's OK. I saw the new size I have set in registry. But after installtion, the size of my product in Control Panel isn't changed.
What should I do to apply the size I set in registry for Control Panel ?
Plz help me again. Thanks u....
Do u see my problem ?
Plz help me again....
Regards.