cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
donghocat_phl
Level 4

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.
Labels (1)
0 Kudos
(16) Replies
Not applicable

[ProgramFilesFolder] is System Folder Properties. This is not a public property, we can’t change this value.
0 Kudos
donghocat_phl
Level 4

Hi lambertpandian,
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.
0 Kudos
Not applicable

It is possible. As per MSDN the CA should be included in UI and execute sequence, the below snippet is from MSDN. I tried a sample it worked for me, but “system folder properties” are predefined values to ease our work. Why can’t you define and use your own property?

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.
0 Kudos
donghocat_phl
Level 4

Hi lambertpandian,
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.
0 Kudos
Not applicable

As per windows “size in ARP is just estimation not appropriate”.
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.
0 Kudos
Not applicable

Hi,
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).
0 Kudos
donghocat_phl
Level 4

Hi lambertpandian,
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....
0 Kudos
Not applicable

Where are you calling the custom action? You should call this at last, otherwise install will overwrite the registry.
0 Kudos
donghocat_phl
Level 4

Ya, I called this CA at last as ur description. After the installation's completed, I saw the size I set for "EstimatedSize" in registry. That means the value of "EstimatedSize" key was'nt overwritten. But the size in Control Panel isn't changed.
Do u see my problem ?
Plz help me again....
Regards.
0 Kudos
Not applicable

I called the custom action “After ISSelfRegisterFinalize”.
0 Kudos
donghocat_phl
Level 4

Oh, "ISSelfRegisterFinalize” is in Basic MSI project, not in InstallScript MSI project..
How can I do that in InstallScript MSI project ?
0 Kudos
Not applicable

OnEnd( ) can help.
0 Kudos
donghocat_phl
Level 4

Hi,
I've tried. And it's not effective.
Any suggestion for me ?
Help me..
0 Kudos
Alpesh
Flexera Alumni

Hi there,

You should modify this key for InstallScript MSI project types -
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\InstallShield_{PRODUCTGUID}.

Thanks,
Alpesh
0 Kudos
donghocat_phl
Level 4

Hi,
I set the value for "EstimatedSize" key in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\InstallShield_{PRODUCTGUID}.
After installation's completed, I saw the value I set in registry. But the size of my product isn't changed. It's the value of "EstimatedSize" key before I set.
How can I apply the value of "EstimatedSize" key for the size of my product in Control Panel ?
Thanks u..
0 Kudos
donghocat_phl
Level 4

Or suggest me a way to count the size of the folders, files in my own property (I created this property - not public properties of InstallShield). Cauz the size of my application in Control Panel is the size of folders, files in property of IS (Ex: INSTALLDIR property..). It's not included the size of my own property.
Any suggestions'll be appreciated.
Here's a reply to keep this thread alive.
Help me..
0 Kudos