installscript


InstallScript and machine.config


I'm having a couple of issues with InstallScript that I can not seem to figure out. The main one is that I need to add the following to the machine.config file:
<system.transactions>
<machineSettings maxTimeout="02:00:00" />
</system.transactions>
but it is adding it as such:
<system.transactions>
<machineSettings>
<maxTimeout>"02:00:00"</maxTimeout>
</machineSettings>
</system.transactions>
Here is the code I'm using to update the file (the messages boxes are for debugging purposes).
function STRING GetMachineConfigPath(hMSI)
STRING strRetVal;
NUMBER nSize, nType;
begin
nSize = MAX_PATH - 1;
MsiGetProperty(ISMSI_HANDLE, "MACHINECONFIGPATH", strRetVal, nSize);
return strRetVal;
end;
function SaveMachineConfigSettings(hMSI)
OBJECT oDoc; // XML Document object
OBJECT oNode; // A node in the XML DOM tree
OBJECT CurrParent; // Current parent node
STRING szFilename;
BOOL successfulLoad;
begin
szFilename = GetMachineConfigPath(hMSI) + "config\\machine.config";
if Is(FILE_EXISTS, szFilename) = FALSE then
MessageBox("Could not find machine.config file.", 0);
return -1;
endif;
set oDoc = CreateObject("Msxml2.DOMDocument");
if (IsObject(oDoc) = FALSE) then
MessageBox("Could not open machine.config file.", 0);
return -1;
endif;
oDoc.Async = FALSE;
oDoc.setProperty("SelectionLanguage", "XPath");
successfulLoad = oDoc.load(szFilename);
MessageBox("File loaded successfully.", 0);
if (successfulLoad = FALSE) then
MessageBox("File did not load successfully.", 0);
return -1;
endif;
set CurrParent = oDoc.documentElement;
set oNode = AddSetting(oDoc, CurrParent, "system.transactions", "");
set CurrParent = oNode;
set oNode = AddSetting(oDoc, CurrParent, "machineSettings", "");
set CurrParent = oNode;
set oNode = AddSetting(oDoc, CurrParent, "maxTimeout", '"02:00:00"');
// Write the XML document to a file.
oDoc.save(szFilename);
MessageBox("File updated successfully.", 0);
set oNode = NOTHING;
set oDoc = NOTHING;
return 0;
end;
function OBJECT AddSetting(oDoc, oParent, szNodeName, szValue)
OBJECT oNode;
begin
// Add a carriage return & line feed to make the output easier to read.
set oNode = oDoc.createTextNode("\n");
oParent.appendChild(oNode);
// Create the new setting node and value.
set oNode = oDoc.createElement(szNodeName);
oNode.text = szValue;
oParent.appendChild(oNode);
MessageBox("Node created successfully.", 0);
return oNode;
end;
Any help you could provide is really appreciated!
I ended up creating a C# console application to modify the file and then running that EXE from the InstallShield installation. This gave me a lot more flexibility and control over the modifying of the file to avoid causing issues.

Related Links

Let Setup.exe return '0'(success) when reinstalling - installshield
Limitations of InstallScript “Is(FILE_EXISTS, filename)”?
InstallScript Reboot after multiple prequisites
InstallScript detect app during upgrade?
InstallShield - Detect USB 3.0 Ports
Execute command line statement in installshield / installscript
InstallScript and machine.config
Need an example of /installfromweb command line switch for Installscript Project Setup.exe
How do you compare versions in InstallScript?
unInstallApplication of InstallShield is not working
How to find if the Installatoion was per user or per machine installation
During uninstallation the dll does not remove from system32 folder
Good resources on InstallScript

Categories

HOME
url-redirection
phantom-dsl
httparty
merge
c99
android-studio-2.2
alexa-skills-kit
pda
toolbox
obfuscation
jsf-2.2
devise
opendj
carousel
onclick
ado.net
gluon-mobile
arangodb
mautic
flash-player
symbol
atlassian-stash
wolframalpha
squashfs
question2answer
joptionpane
draft-js-plugins
ckfinder
game-theory
dapper-extensions
appirater
flooding
asymptotic-complexity
sinch
bringtofront
ceylon
magento-1.8
custom-controls
zend-debugger
dumpbin
contacts
vue-chartjs
fiware-cygnus
openproject
google-earth-engine
z-notation
odroid
gdata
css-position
cin
typesafe-config
mongoose-schema
chef-solo
spring-mvc-test
kill
comparison-operators
attributeerror
microsoft-metro
claims
dbcontext
dtsearch
convex-optimization
page-replacement
payload
rackspace-cloud
structuremap4
cudd
jtwig
lua-telegram-bot
qbxml
rasterize
avisynth
roadkill-wiki
intel-c++
google-books
toolkit
mirror
public-html
infosphere-spl
rapidsvn
entry-point
machine-instruction
cbind
universal-image-loader
malformedurlexception
xml-dsig
ray
model-driven-development
twisted.web
subgraph
fusefabric
isa-swizzling
floating-point-exceptions
apache-commons-dbutils
listactivity
pylucene
cgbitmapcontextcreate
msr
qglwidget
commerceserver2007
vs-android
sun
image-capture

Resources

Encrypt Message