Reputation: 2197
I am using a silent install file in InstallShield X to upgrade an existing program.
When the install runs normally (non-silent) it prompts the user for various information, which gets written to an ini file. If it is a new install it provides default values for the prompts, and if it is an upgrade it shows the value from the ini file.
I want to create a silent install that updates some values in the ini file without overwriting others. The problem is that when I create the setup.iss it explicitly uses the values from my ini file.
Is there a way to tell the silent install to accept an existing value? I.e. as if the user just clicked "Next" without changing the displayed value?
Here's a contrived example:
Suppose the first time install prompts for "Name" and I enter "WileCau". The name is stored in the program ini file.
Next time I run the install and it prompts for "Name" it will read the ini file and display "WileCau" in the entry field, and I just click "Next" to accept the existing value.
The problem is if I create a silent install for this it contains something like:
...
[{GUID}-DlgOrder]
...
Dlg1={GUID}-AskText-0
...
[{GUID}-AskText-0]
szText=WileCau <-- Puts this text in the entry field
Result=1 <-- Indicates clicking "Next"
...
Where it says szText=WileCau
I want it to use whatever value is in the user's entry field (e.g. maybe it's "Bob").
Upvotes: 1
Views: 2361
Reputation: 15905
You can implement your own silent dialog routines using SilentWriteData
and SilentReadData
. For example you might check at write time whether the value is the default, and if it is, write a special string. At read time, if you read the special string back, don't override the default. You would have to do this for all existing dialogs that you use during OnFirstUIBefore and need this behavior, possibly including overrides for the ones InstallShield provides.
Upvotes: 3
Reputation: 21426
INI entries are formatted, so they support installer properties. This means that you can use an installer property instead of a hard-coded value. For example:
[MY_PROPERTY]
This property can then be associated with your custom control which retrieves the information from your user (for example an edit box).
Upvotes: 1