PDA

View Full Version : How to Change Value of @PRODUCT_NAME Programmatically?



DataAnalyzer
06-03-2014, 12:20 PM
I can see that the value is set from the Product Configuration level, but I need a different name for each release within it. Based on the flags, I know what I want to name each release. Is there a way to set that programmatically and if so, within which event?

TsungH
06-16-2014, 04:12 PM
ISCmdBld.exe is able to set property value with -z switch.

DataAnalyzer
06-16-2014, 04:27 PM
ISCmdBld.exe is able to set property value with -z switch.

Interesting. I've never used SCmdBld.exe. We just use the Build feature withing InstallShield. Is there a way to set this within the release properties or in the InstallScript?

TsungH
06-17-2014, 06:22 PM
If you are working with Basic MSI, InstallScript MSI, Merge Module project types, you can change product name at General Tab for a Product Configuration (http://helpnet.flexerasoftware.com/installshield21helplib/installshield21helplib.htm#StartTopic=helplibrary/ProdConfigGeneralTab.htm).If you are working with InstallScript project type, I haven't spent any time on that in recent years, I am not aware of any.

DebbieL
06-18-2014, 09:16 AM
You can use the automation interface to make changes programmatically to your project. You can also use the automation interface to build releases in your project. So, you may want to look into using the automation interface for programmatically changing the product name at the product configuration level. Here are some relevant links:

Automation Interface (http://helpnet.flexerasoftware.com/installshield21helplib/installshield21helplib.htm#StartTopic=helplibrary/IHelpAutomation.htm)
ISWiProductConfig Object (http://helpnet.flexerasoftware.com/installshield21helplib/installshield21helplib.htm#StartTopic=helplibrary/IHelpAutoISWiSKU.htm)
ISWiProductConfigs Collection (http://helpnet.flexerasoftware.com/installshield21helplib/installshield21helplib.htm#StartTopic=helplibrary/IHelpAutoISWiSKUs.htm)
AddRelease Method (http://helpnet.flexerasoftware.com/installshield21helplib/installshield21helplib.htm#StartTopic=helplibrary/IHelpAutoAddRelease.htm)
ISWiRelease Object (http://helpnet.flexerasoftware.com/installshield21helplib/installshield21helplib.htm#StartTopic=helplibrary/IHelpAutoISWiRelease.htm)
Build Method (http://helpnet.flexerasoftware.com/installshield21helplib/installshield21helplib.htm#StartTopic=helplibrary/IHelpAutoISWiReleaseBuild.htm)

DataAnalyzer
06-18-2014, 05:37 PM
Yes, I can manually change the property on the screen, but my question is how to do it programmatically. I have several releases within a product. The Product Name is set at the Product level, but I need a different name for each release. Each release has different flags, so I know what it should be. I just don't know what to set.


If you are working with Basic MSI, InstallScript MSI, Merge Module project types, you can change product name at General Tab for a Product Configuration (http://helpnet.flexerasoftware.com/installshield21helplib/installshield21helplib.htm#StartTopic=helplibrary/ProdConfigGeneralTab.htm).If you are working with InstallScript project type, I haven't spent any time on that in recent years, I am not aware of any.

DataAnalyzer
06-18-2014, 05:40 PM
Did you just send me to the entire help file? I've already searched the help file and can't find what I need. Maybe I'm just clueless. Is there an example that can show me what to do? What property to set programmatically in the script?

I need to programmatically change the product name based on the features included. For instance, Retail, Trial, Beta, etc. I have separate releases within a product and would like to set that accordingly.

Would also like to set things like the copyright, signing code, postbuild properties, etc. programmatically rather than having to set it manually for each tab, but that's a different dream.



You can use the automation interface to make changes programmatically to your project. You can also use the automation interface to build releases in your project. So, you may want to look into using the automation interface for programmatically changing the product name at the product configuration level. Here are some relevant links:

Automation Interface (http://helpnet.flexerasoftware.com/installshield21helplib/installshield21helplib.htm#StartTopic=helplibrary/IHelpAutomation.htm)
ISWiProductConfig Object (http://helpnet.flexerasoftware.com/installshield21helplib/installshield21helplib.htm#StartTopic=helplibrary/IHelpAutoISWiSKU.htm)
ISWiProductConfigs Collection (http://helpnet.flexerasoftware.com/installshield21helplib/installshield21helplib.htm#StartTopic=helplibrary/IHelpAutoISWiSKUs.htm)
AddRelease Method (http://helpnet.flexerasoftware.com/installshield21helplib/installshield21helplib.htm#StartTopic=helplibrary/IHelpAutoAddRelease.htm)
ISWiRelease Object (http://helpnet.flexerasoftware.com/installshield21helplib/installshield21helplib.htm#StartTopic=helplibrary/IHelpAutoISWiRelease.htm)
Build Method (http://helpnet.flexerasoftware.com/installshield21helplib/installshield21helplib.htm#StartTopic=helplibrary/IHelpAutoISWiReleaseBuild.htm)

GrantK
12-29-2014, 11:40 AM
in the automation interface, refer to property: ProductName
from the following link:
http://helpnet.flexerasoftware.com/installshield21helplib/installshield21helplib.htm#StartTopic=helplibrary/IHelpAutoISWiProject.htm

DataAnalyzer
12-29-2014, 12:12 PM
Thanks, but I'm not necessarily interested in writing a separate program to automate InstallShield. I'd like to just set these values programmatically in the IS script.

Is that possible? Thanks.


in the automation interface, refer to property: ProductName
from the following link:
http://helpnet.flexerasoftware.com/installshield21helplib/installshield21helplib.htm#StartTopic=helplibrary/IHelpAutoISWiProject.htm

DLee65
12-30-2014, 10:43 AM
*EDIT - removed snarky remarks*
The answer is, NO, InstallScript does not have a property that can set it's compile time name. It has to be set at compile time by some type of external method that requires you to program it to set programmatically.
In fact I am not sure what you are trying to accomplish - anything in script would ONLY apply to runtime because code in script is not executed at compile time, it is executed at runtime.

Sorry no simple answers. So Yes, it is possible but not without work.

BTW, I found your reply to Debbie very rude as she pointed you directly to the interfaces required to modify a build at compile time. However, to accomplish this goal you will need to switch from the workflow of opening the IDE and compiling the setup but rather compile from a command line using the automation interface or command line.

DataAnalyzer
12-30-2014, 11:00 AM
No need to be condescending. If I knew the answer, I wouldn't be asking. And are you implying I'm afraid of working? I'm trying to solve a problem, not waste your or anyone else's time.

You're the first response to clarify that this feature request couldn't be done programmatically within InstallShield, so thank you for that.

Per your recommendations and others, if I want to implement this feature, I'll need to get a VB6 or .NET developer to create this for me. That would be difficult to manage and change. I'll just manually create a new Product Configurations for each name I need which is what I was trying to consolidate. It's nice to have different releases under one Product Configuration, but I find it odd that all the releases have to be the same Product Name.


This is too precious. You want to set the name programmatically but you do not want to utilize the tools that people have pointed to you to program a solution.
The answer is, NO, InstallScript does not have a property that can set it's compile time name. It has to be set at compile time by some type of external method that requires you to program it to set programmatically.

Sorry no simple answers. So Yes, it is possible but not without work.

DLee65
12-30-2014, 11:01 AM
Did you just send me to the entire help file? I've already searched the help file and can't find what I need. Maybe I'm just clueless. Is there an example that can show me what to do? What property to set programmatically in the script?

I need to programmatically change the product name based on the features included. For instance, Retail, Trial, Beta, etc. I have separate releases within a product and would like to set that accordingly.

Would also like to set things like the copyright, signing code, postbuild properties, etc. programmatically rather than having to set it manually for each tab, but that's a different dream.

Why not create separate configurations for Retail, Trial, and Beta and set the name in the configuration settings? Then you can specify which one to build from a command line or just click the correct one from the UI? If what I was trying to accomplish is to have a configuration like:
<ProductName>_Alpha
<ProductName>_Beta
<ProductName>_RC1
<ProductName>_Retail
<ProductName>_Trial
<ProductName>_etc

In this case you should have a finite list of configurations. If the number of configurations is finite then specifying separate configurations is the correct method to accomplish this.
If, however, you are trying to obtain something like
<ProductName>_0.0.1_Alpha, where the version value changes with each build then you will need some type of external process to configure the compile settings dynamically. Automation interface is hands down the best method for implementation here.

EDIT: Just read your previous reply. I can understand if you are not familiar with .NET, but if you are familiar with vbscript or javascript you can implement the automation interface using that by using CreateObject("ISWIAUTO##.ISPROJECT") <I think that is the syntax>. There should be plenty of examples here on the forums of how others have used it.

Here is one example: http://helpnet.installshield.com/installshield18helplib/IHelpAutoExReport.htm

DataAnalyzer
01-13-2015, 01:16 PM
Yes, I could and have created a separate configuration for each one. Unfortunately, that's not very efficient.

I was hoping to have a separate release within each configuration because they would share the same configuration settings (and flags) plus each release having their own flag(s). If I could programmatically change the product name based on the flags, I'd be done. Instead, I have to create separate configurations and manually try to keep all their settings in snyc. Sounds like there isn't a way to do this.


Why not create separate configurations for Retail, Trial, and Beta and set the name in the configuration settings? Then you can specify which one to build from a command line or just click the correct one from the UI? If what I was trying to accomplish is to have a configuration like:
<ProductName>_Alpha
<ProductName>_Beta
<ProductName>_RC1
<ProductName>_Retail
<ProductName>_Trial
<ProductName>_etc

In this case you should have a finite list of configurations. If the number of configurations is finite then specifying separate configurations is the correct method to accomplish this.
If, however, you are trying to obtain something like
<ProductName>_0.0.1_Alpha, where the version value changes with each build then you will need some type of external process to configure the compile settings dynamically. Automation interface is hands down the best method for implementation here.

EDIT: Just read your previous reply. I can understand if you are not familiar with .NET, but if you are familiar with vbscript or javascript you can implement the automation interface using that by using CreateObject("ISWIAUTO##.ISPROJECT") <I think that is the syntax>. There should be plenty of examples here on the forums of how others have used it.

Here is one example: http://helpnet.installshield.com/installshield18helplib/IHelpAutoExReport.htm

DataAnalyzer
03-05-2015, 04:03 PM
Since the responses haven't solved this problem, I'd like to rephrase this.

I'd like to have one setup program that contains multiple versions. Based on the information they enter (could be a serial number or options they choose), I can have the script set the right features and install it properly. However, I'd like the name of the product in the Windows Programs list to reflect the selection they made.

How would I change the product name in my script so my setup program that contains multiple versions/products can do this?