- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Application name change dynamically
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
- Tags:
- installshield
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi @Sashikanta ,
Help me with few more details:
- What type of project you are using?-I could get it is basic msi project from the sample you had added here
- If Basic MSI-Add the below code:
function MyFunction(hMSI)
// To Do: Declare local variables.
STRING svName;
begin
MsiSetProperty(hMSI, "ProductName", "TrailProduct");
// To Do: Write script that will be executed when MyFunction is called.end;
- Since it is basic MSI project,you have to use hMSI as handle where if it is InstallScript project use ISMSI_HANDLE as MSI handle.
- Add installscript custom action and add this function name as Function Name argument
- Sequence it in initial phase:Here you can do Install Exec Sequence->After CostInitialize
- If Basic MSI-Add the below code:
- If it is InstallScript project steps will slightly vary like adding the above code in InstallScript events which you could find under InstallScript view
- Build and execute it will work(I had verified as well :-))
Thanks,
Jenifer
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi Jenifer,
Thank you for the solution. I changed the application name successfully . just one step to my goal is My desktop shortcut name not changed can you help me to change the shortcut name by install shield script.
Thank You
Wait for your positive reply.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi @Sashikanta,
What you meant by application name, is it the executable installed by the installer or the installer itself ?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi @Sashikanta ,
Application name and product name are same.Please try with above mentioned function
MsiSetProperty(ISMSI_HANDLE,"ProductName", "My Product Name");
as in my last reply.
Hope it helps,
Thanks,
Jenifer
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi Jenifer,
Thank You For Your reply.
My Goal is to change product name by Script.
I tried With The script. But unable to change the product name. Can you help me more to achieve that? here I am attaching my script.
Script :
#include "isrt.h"
#include "iswi.h"
export prototype Func1(HWND);
function Func1(hMSI)
STRING svName;
begin
MsiSetProperty(ISMSI_HANDLE, "ProductName", "TrailProduct");
end;
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi @Sashikanta ,
Help me with few more details:
- What type of project you are using?-I could get it is basic msi project from the sample you had added here
- If Basic MSI-Add the below code:
function MyFunction(hMSI)
// To Do: Declare local variables.
STRING svName;
begin
MsiSetProperty(hMSI, "ProductName", "TrailProduct");
// To Do: Write script that will be executed when MyFunction is called.end;
- Since it is basic MSI project,you have to use hMSI as handle where if it is InstallScript project use ISMSI_HANDLE as MSI handle.
- Add installscript custom action and add this function name as Function Name argument
- Sequence it in initial phase:Here you can do Install Exec Sequence->After CostInitialize
- If Basic MSI-Add the below code:
- If it is InstallScript project steps will slightly vary like adding the above code in InstallScript events which you could find under InstallScript view
- Build and execute it will work(I had verified as well :-))
Thanks,
Jenifer
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi Jenifer,
Thank you for the solution. I changed the application name successfully . just one step to my goal is My desktop shortcut name not changed can you help me to change the shortcut name by install shield script.
Thank You
Wait for your positive reply.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi Jenifer,
Thank you for the solution. I changed the application name successfully . just one step to my goal is My desktop shortcut name not changed can you help me to change the shortcut name by install shield script.
Thank You
Wait for your positive reply.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi Jenifer,
I changed the name dynamically but, the desktop icon name and Startmenu search Still showing old name . only Control panel product name are changed. please help me to get the complete solution.
How can I change all the places the product name? Please help me to get the Solution.
I attached all the Screenshot. please help me to get the solution.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi @Sashikanta ,
You can use AddFolderIcon installscript which creates shortcut for you but there are some tricky things you have to follow since shortcut displayname won't take property values directly as mentioned in the below link:
https://community.flexera.com/t5/InstallShield-Knowledge-Base/Dynamic-Shortcut-Names/ta-p/3978
Steps to do:
- You have to add installscript function which will create shortcuts for the needed files as given in example:
- https://helpnet.flexerasoftware.com/installshield22helplib/Subsystems/installshield22langref/helplibrary/LangrefAddFolderIcon_example00000605.htm#langref_appendixa_619625892_addfoldericon_ex_1
- Create a custom action which is of property In-Script execution as Deferred Execution in System Context since it needs files to be transferred with exec condition of NOT REMOVE.For more details:https://helpnet.flexerasoftware.com/installshield22helplib/helplibrary/IHelpCustomActionsInScriptExecution.htm
- The tricky problem here:In deferred custom action we can't get MSI properties directly just like using function MsiGetProperty.You have to follow steps defined here to access MSI properties via CustomActionData:https://helpnet.flexerasoftware.com/installshield22helplib/helplibrary/AccessingProps-DeferredCAs.htm
- You might need INSTALLDIR if your shortcut resides as well productname as properties
- You can get array of MSI properties in your installscript code by parsing properties from CustomActionData
- You have to add function to delete shortcut on uninstallation as well using DeleteFolderIcon function
- Call this function from another InstallScript custom action with Execution sequence of After RemoveiniFiles with Exec condition of REMOVE="ALL"
- With all these you can achieve the desired result
Thanks,
Jenifer
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi @Sashikanta ,
You can try setting application/product name dynamically by using MsiSetProperty of installscript.Since productname is of MSI property.
Sample code would be:
export prototype Func1(HWND);
function Func1(hMSI)
STRING svName;
begin
MsiSetProperty(hMSI, "ProductName", "My Product Name");
endif;
end;
For installscript:
MsiSetProperty(ISMSI_HANDLE,"ProductName", "My Product Name");
For more details about MsiSetProperty,please refer:https://helpnet.flexerasoftware.com/installshield22helplib/helplibrary/IHelpIScriptWIProperty.htm#customizinginstallbehavior_1713100086_1022849
Thanks,
Jenifer