cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
marketware
Level 6

How to avoid INI update

When a user runs our install, we prompt them for values that are placed in an INI file (Server IP, Company Name, etc.).

There are default values for these prompted values and in some situations (like when they install in a training class) the defaults are appropriate.

However, once a user has installed the system, if we run an upgrade, the default values entered during the initial install are replaced with the default values.

How can I tell the system NOT to touch the INI file on a Minor Upgrade?

Thanks!!

bob:confused:
Labels (1)
0 Kudos
(13) Replies
hidenori
Level 17

Try setting "Not Installed" to the condition for the component associated with the INI file entry. You may also need to set the Reevaluate Condition setting to Yes.
0 Kudos
marketware
Level 6

I've created a component called INIFile.

I've associated the component with the INI file.

I've set the condition of the component to:

INIFile = "Not Installed"

And I've set the Reevaluate Condition to Yes.

But now the INI file is not even getting installed.

What might I be doing wrong? Also, the icon for the component has a red exclamation (!) on it. But the software isn't giving any feedback as to what's wrong.

Thanks.
:confused:
bob
0 Kudos
hidenori
Level 17

You need to associate the component with a feature. Also you just need to put "Not Installed" to the Condition setting.
0 Kudos
marketware
Level 6

I set the component's condition to:

(IS_MINOR_UPGRADE=0) Or (IS_MAJOR_UPGRADE=0)

And it works great. Thank you for your help!!

bob
0 Kudos
Roman1
Level 9

Hello Hidenori,

you are talking about "Transitive Components".

Be carefull, setting new condition to component and reevaluate it by reinstallation.

If the component was installed and now the condition is false by reevaluation,
this component is being removed!
0 Kudos
marketware
Level 6

I used your advice and set the condition to "Not Installed". But now it uninstalls the INI and shortcuts on a minor upgrade. My goal is for the install to not touch either on an minor upgrade.

Ideas?

bob

:eek:
0 Kudos
marketware
Level 6

I removed the reevaluate condition and it doesn't uninstall on an upgrade, but it overwrites with the default INI as it was before.

BTW, I set the Never Overwrite condition to Yes, but it still Overwrote anyway. 😞

Ideas?

bob
0 Kudos
marketware
Level 6

I guess the $64 question is how can I turn off the UNINSTALL feature of components that use a condition for install/upgrade?
0 Kudos
marketware
Level 6

I set the components to be permenant, so that keeps them from being removed in an update, and not modified in an update. So I guess we are there, but I'd like them removed in an uninstall, so this isn't the best solution.

Any Ideas or is this the best I can do?

Thanks.

bob:confused:
0 Kudos
hidenori
Level 17

Another approach that you can try is to set a condition to the WriteIniFiles action so that the INI file changes will not occur during minor upgrades.

[LIST=1]
  • Go to the Custom Actions and Sequences view.
  • Expand the Sequences > Installation > Execute node.
  • Set "Not Installed" to the Condition field of the WriteIniFiles action.
  • Rebuild your setup.

    Please remove the condition from the underlying component, and change the Reevaluate Condition setting back to No.

    Hope that helps.
  • 0 Kudos
    marketware
    Level 6

    Thank you! That appears to be it.

    Now if there was only a way to detect the existance of an SQL Instance, or a way to ignore script errors if we run a query against a non-existent instance of SQL server, I could go on to other projects.

    bob:o
    0 Kudos
    hidenori
    Level 17

    You may want to try executing the ISSQLServerList action which queries and sets the existing instances of Microsoft SQL server to the IS_SQLSERVER_FLATLIST Windows Installer property in a comma-delimited manner. Then, you would need to write your own custom action that will check to see if the desired instance is included in the list.
    0 Kudos
    hidenori
    Level 17

    You might want to use a substring operator in your conditional expressions in order to determine if the desired instance name is in IS_SQLSERVER_FLATLIST.

    PROPERTY >< "substring"

    syntax as one possibility...
    0 Kudos