This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Update xml file on maintenance
Subscribe
- 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
‎Jan 08, 2009
03:22 AM
Update xml file on maintenance
Hello Everybody
I have been searching the knowledge base for quite a while and cannot work out an easy way to do this so i am hoping someone here may know.
(Basic msi project)
I have a dialog where the user enters a url, I place this value into a SERVERLOCATION property. Once the rest of the install dialogs are complete I write the SERVERLOCATION value to an XML file (config file) and also write it to the registry so it can be retrieved later.
On maintenance we allow the user to update this server url, so far i have got the SERVERLOCATION reading the value out of the registry so what the user sees is what they entered on install. However if they change this value i cant see how to make installshield write that value to xml file once more.
The xml file is in its own component etc, i have read items about having to reinstall the component but cant work out how this is done either (also not ideal as the xml file contains other values).
Anyone come across or solved something like this before - any help would be great.
Thanks Stuart
I have been searching the knowledge base for quite a while and cannot work out an easy way to do this so i am hoping someone here may know.
(Basic msi project)
I have a dialog where the user enters a url, I place this value into a SERVERLOCATION property. Once the rest of the install dialogs are complete I write the SERVERLOCATION value to an XML file (config file) and also write it to the registry so it can be retrieved later.
On maintenance we allow the user to update this server url, so far i have got the SERVERLOCATION reading the value out of the registry so what the user sees is what they entered on install. However if they change this value i cant see how to make installshield write that value to xml file once more.
The xml file is in its own component etc, i have read items about having to reinstall the component but cant work out how this is done either (also not ideal as the xml file contains other values).
Anyone come across or solved something like this before - any help would be great.
Thanks Stuart
(10) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 13, 2009
07:33 PM
Hello Stuart, have you tried the XML File Changes view under System Configuration in the Installation Designer? This is where I make my XML file changes.
Tim
Tim
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 14, 2009
02:54 AM
Thanks a lot for the reply. I have tried that area as this is where i set the value on Install, however on Maintenance (modify) this is not executed again.
It feels like they have really improved the install side with the UI on 2009 but the Maintenance side is still in the "skilled users only\have days spare to work it out" box.
It feels like they have really improved the install side with the UI on 2009 but the Maintenance side is still in the "skilled users only\have days spare to work it out" box.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 14, 2009
11:22 AM
We have the same problem and I believe the best solution is to read the value from the XML file first before copying or over writing the file. So after the copy phase, you can update both the registry and the XML file. You can do this by using the COM interface into XML functions. If you are not familiar on how to do this, here is a link that contains an example. Just to let you know, the example writes values to the XML file. In order to read the value in question, modify the line
oNode.attributes.getNamedItem("value").value = strValue;
-- to be --
strValue = oNode.attributes.getNamedItem("value").value;
Hope this helps...
oNode.attributes.getNamedItem("value").value = strValue;
-- to be --
strValue = oNode.attributes.getNamedItem("value").value;
Hope this helps...
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 05, 2009
09:01 AM
Hi,
If I consider the amount of threads about this topic, it seems that many people have troubles making XML file changes in maintenance mode.
The funny thing is that the INI file changes do work trouble-free in maintenance mode.
I use Installshield 2008, but it seems that Installshield 2009 has got the same problem.
I would like to know whether the Acresso people have some hint, as I haven't read any answer from them about this topic.
Regards
If I consider the amount of threads about this topic, it seems that many people have troubles making XML file changes in maintenance mode.
The funny thing is that the INI file changes do work trouble-free in maintenance mode.
I use Installshield 2008, but it seems that Installshield 2009 has got the same problem.
I would like to know whether the Acresso people have some hint, as I haven't read any answer from them about this topic.
- Is there any issue in Installshield which prevents XML file changes in maintenance mode?
- If there is no issue, why are the INI file changes properly performed in maintenance mode?
Regards
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 05, 2009
09:18 AM
Hi
In the end had I to change tact on this as i couldnt quite get it to work for me. This is the story of my install shield life unfortunately, spend hours\days trying to do something then realise so many other people have the same issue yet there is no obvious resolution. I wouldn't hold your breath on a quick answer from them or resolution.
Although I must say thanks to everyone who tried to help me
In the end had I to change tact on this as i couldnt quite get it to work for me. This is the story of my install shield life unfortunately, spend hours\days trying to do something then realise so many other people have the same issue yet there is no obvious resolution. I wouldn't hold your breath on a quick answer from them or resolution.
Although I must say thanks to everyone who tried to help me
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 06, 2009
08:57 AM
Hi,
After fighting with Installshield 2008 a bit, a colleague found an interesting workaround which avoids manipulating XML files in an Installscript.
The rule is: the XML File Changes are only performed if a feature is installed or reinstalled!
Obviously, this rule is documented nowhere!
Bearing that in mind, you can implement a little workaround:
[LIST=1]
Pack the XML file (MyFile.xml) you want to update when performing a maintenance (change) in a component (Component_MyFile.xml).
Pack this component in a separate feature (Feature_Config).
All you need to do is force MSI to reinstall this feature (Feature_Config) when your setup is launched in Maintenance(change) mode.
Create a CustomAction (let's call it enforceFeatureReinstallation) which calls an installscript function of the same name.
Set the condition of this Custom Action to Installed AND _IsMaintenance="change"
Make sure you call your CustomAction (enforceFeatureReinstallation) from your UISequence.
The corresponding installscript function consists of adding the name of your feature to the REINSTALL property.
Regards
After fighting with Installshield 2008 a bit, a colleague found an interesting workaround which avoids manipulating XML files in an Installscript.
The rule is: the XML File Changes are only performed if a feature is installed or reinstalled!
Obviously, this rule is documented nowhere!
Bearing that in mind, you can implement a little workaround:
[LIST=1]
function INT enforceFeatureReinstall (hMsi)
STRING szTmp;
NUMBER iLen;
STRING szFeatureToReinstall;
begin
szFeatureToReinstall = "Feature_Config";
// Get the content of the current REINSTALL property
MsiGetProperty(hMsi, "REINSTALL", szTmp, iLen);
// Add the szFeatureToReinstall string to the REINSTALL property
if (szTmp == "") then
szTmp = szFeatureToReinstall;
else
szTmp = szFeatureToReinstall + "," + szTmp;
endif;
MsiSetProperty(g_hMsi, "REINSTALL", szTmp);
return ERROR_SUCCESS;
end;
Regards
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 06, 2009
09:06 AM
Thanks for posting that its good knowledge, hopefully it will help others too.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 06, 2009
09:10 AM
Cheers mate!
Phew! That one kept me busy for a little while!
Phew! That one kept me busy for a little while!
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 12, 2009
07:10 PM
Yes, thanks! 🙂
In our Basic MSI project, I did something similar using a vbscript CA:
In our Basic MSI project, I did something similar using a vbscript CA:
strFeatureToReinstall = "Feature_Config"
strReinstall = Session.Property("REINSTALL")
If strReinstall = "" then
strReinstall = strFeatureToReinstall
Else
strReinstall = strReinstall + "," + strFeatureToReinstall
End If
Session.Property("REINSTALL") = strReinstall
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 13, 2009
11:20 AM
I'm not sure how I missed this thread the first time around, but I wanted to mention a slight tweak to this approach that would avoid the custom code: the Reinstall control event. Of course, as a control event, that would only work when the dialog sequence was shown. Thus this may not be appropriate for all needs, but would probably be reasonable for cases where the user had to specify a new value in such a dialog.
![](/skins/images/D60DF682EA37BF37032955CE10F3F0BB/responsive_peak/images/icon_anonymous_message.png)