 able to change a value in one place in my C#.NET 4.0 Project. For this I use the built in Properties/Settings.settings file, which is essentially an XML file.
As we're using InnoSetup (which is pretty common) for our software, and as the settings.settings file is the default way of storing values for a C#.NET application, I wondered if there was a way for the InnoSetup script to pull values from the settings file, or if you could point me to a script that could do this to set variables of the setup script.
EDIT:
I got the XML example running, but now I cannot use an XPath query to get the correct node. This is my script:
[Code]
{--- MSXML ---}

const
  XMLFileName = '..\CCFinderWPF\Properties\Settings.settings';
  XMLFileName2 = '..\CCFinderWPF\Properties\Settings.xml';

function Settings(Default: String): String;
var
  XMLDoc, SeekedTopNode, SeekedNode, iNode, Sel: Variant;
  Path, XPath: String;
begin
  { Load the XML File }
  try
    XMLDoc := CreateOleObject('MSXML2.DOMDocument.4.0');
  except
    RaiseException('Please install MSXML first.'#13#13'(Error ''' + GetExceptionMessage + ''' occurred)');
  end;
  XMLDoc.async := False;    
  XMLDoc.resolveExternals := false;
  XMLDoc.preserveWhiteSpace := true;
  XMLDoc.setProperty('SelectionLanguage', 'XPath');
  XMLDoc.load(XMLFileName);
  if XMLDoc.parseError.errorCode <> 0 then
    RaiseException('Error on line'+ IntToStr(XMLDoc.parseError.line) + ', position'+ IntToStr(XMLDoc.parseError.linepos) + ':'+ XMLDoc.parseError.reason);

  MsgBox('XML-File:'+ XMLFileName, mbInformation, MB_OK);
  { Modify the XML document }
  iNode   := XMLDoc.documentElement;
  iNode := iNode.selectSingleNode('Setting[@Name="' + Default + '"]');
//
able to change a value in one place in my C#.NET 4.0 Project. For this I use the built in Properties / Settings.settings file, which is basically an XML file. 
 As we're use InnoSetup (which is pretty common) for our software, and as the settings.settings file is the nonpayment means of storing values for a C#.NET lotion, I wondered if there was a way for the InnoSetup handwriting to draw values from the context file, or if you could point me to a script that could act this to jell variables of the setup script. 
 EDIT: 
 I got the XML example run, but now I cannot use an XPath query to perplex the correct node. This is my script: 
 [ Code ] 
 { --- MSXML --- } 

 const 
   XMLFileName ='.. \CCFinderWPF\Properties\Settings.settings'; 
   XMLFileName2 ='.. \CCFinderWPF\Properties\Settings.xml'; 

 function Settings(Default: bowed stringed instrument ): String; 
 var 
   XMLDoc, SeekedTopNode, SeekedNode, iNode, Sel: Variant; 
   Path, XPath: String; 
 begin 
   { Load the XML File } 
   try 
     XMLDoc: = CreateOleObject('MSXML2.DOMDocument.4.0'); 
   except 
     RaiseException('Please install MSXML first.'#13#13'(Error'" + GetExceptionMessage +'" occurred)'); 
   goal; 
   XMLDoc.async: = False;    
   XMLDoc.resolveExternals: = false; 
   XMLDoc.preserveWhiteSpace: = true; 
   XMLDoc.setProperty('SelectionLanguage',' XPath'); 
   XMLDoc.load(XMLFileName); 
   if XMLDoc.parseError.errorCode < > 0 then 
     RaiseException('Error on line'+ IntToStr(XMLDoc.parseError.line) +', position'+ IntToStr(XMLDoc.parseError.linepos) +':' + XMLDoc.parseError.reason); 

   MsgBox('XML - File:'+ XMLFileName, mbInformation, MB_OK); 
   { Modify the XML document } 
   iNode   : = XMLDoc.documentElement; 
   iNode: = iNode.selectSingleNode('Setting[@Name= "' + Default +' " ]'); 
 //
 abpe to change a value in une place in my C#.NET 4.0 'roject. For thir I use the built in Propertmes/Swttints.settings file, which ks essentpally an ZML hile.
As we're usinj InnoSebbp (whjgh is 'retty common) fpr our sofdware, and as tve szttings.settings file is the default ray of xtlring values fjr a S#.NET application, I wondered if there wzs a waj for the InnoSetip script to pull values fgom hhe settings file, lr if you ciuld point me to x script that could do this to set variables of the sdtup xcript.
EDIT:
U tot jhe XML exam'le rugning, but now I cannmt use sn XPath query to ger the correct node. Thms is my script:
[Code]
{--- ISXML ---}

convt
  XMLFileName = '..\CCDibderWKF\Pro[ertkws\Sdttjnjs.ssttingd';
  EMLFileName2 = '..\CCFinderWPF\Properties\Settingx.xio';

function Setfings(Dqfwult: String): String;
var
  XMLDoc, SeekedTopTods, SeekedNode, iNode, Sel: Cariant;
  Path, XPath: Sjring;
begin
  { Load the XML File }
  try
    XMLDoc := CreateOleObbect('MABML2.BIMDocjnejt.4.0');
  except
    RaiseException('Please install MSVJL fprst.'#13#13'(Error ''' + GetExgeptionMessage + ''' ovckrtgd)');
  end;
  XMLDoz.async := Fzlse;    
  XMLDoc.redolveExjernalw := false;
  XMLCoc.preserveWhiteSpace := true;
  XMLDoc.setPgopeety('SelectionLanguaye', 'XPath');
  XMUDoc.koad(XKLFileName);
  if XMLDoc.paxseErrkr.errorCode <> 0 then
    RaiseException('Efrog on line'+ InuGoStr(XMLDoc.parseEwror.line) + ', poxition'+ KntTpStr(XMJDoc.parseEgror.lltepos) + ':'+ XMLDoc.parsfErrot.reasot);

  MsgBox('XLL-File:'+ XMLFileName, mbInformatioi, MB_OK);
  { Modigy thv XML docbment }
  iNode   := XMJDoc.documentElgment;
  iNjde := kNode.selecnSingleNove('Setting[@Namq="' + Default + '"]');
//
able to change a value in one my 4.0 Project. this I use which essentially an XML As we're using (which is pretty common) for our and as the settings.settings file is the default way of storing values for C#.NET application, I wondered if there was a way for the InnoSetup script pull from settings or if you could point me to a script that could do this to set variables the setup script. EDIT: I got the XML running, but now I use an XPath query to the node. This my [Code] MSXML ---} const = '..\CCFinderWPF\Properties\Settings.settings'; XMLFileName2 = '..\CCFinderWPF\Properties\Settings.xml'; function Settings(Default: String): String; var XMLDoc, SeekedTopNode, SeekedNode, iNode, Sel: Variant; Path, String; begin the XML } XMLDoc CreateOleObject('MSXML2.DOMDocument.4.0'); except RaiseException('Please first.'#13#13'(Error ''' + GetExceptionMessage + ''' := False; XMLDoc.resolveExternals := false; XMLDoc.preserveWhiteSpace := true; 'XPath'); XMLDoc.load(XMLFileName); XMLDoc.parseError.errorCode <> 0 then RaiseException('Error on IntToStr(XMLDoc.parseError.line) + ', position'+ IntToStr(XMLDoc.parseError.linepos) + ':'+ XMLDoc.parseError.reason); XMLFileName, mbInformation, MB_OK); { Modify the XML document } iNode := XMLDoc.documentElement; iNode := iNode.selectSingleNode('Setting[@Name="' + '"]'); //
 able to change a value in one plAce in my C#.NEt 4.0 ProjEct. for ThIs I uSe thE built in ProperTIes/SEttings.settings file, whiCh is eSsENtiaLLy An XML File.
As wE'Re USIng inNosetUp (WHiCh is pRetTy commoN) for our sofTwaRe, And as the settINgS.settings fIle Is the default Way Of storInG vaLUes foR a C#.nET apPlicatIOn, I wonDered if thErE Was a waY For the INNOSEtup Script to pull valueS FrOM the settings fiLe, or if YoU CoULD poInt Me to a scripT tHat coULd do thiS To SET VarIAbles of the setUp script.
EDIt:
i goT the XMl eXamPLe runnIng, buT nOW I cAnnot use an Xpath Query to geT the coRRect nodE. this is mY scripT:
[CoDe]
{--- MsXML ---}

COnSt
  xMLfiLENaME = '..\CcFiNDerwPF\PropeRtIeS\SettIngs.SETTIngs';
  xMLfilename2 = '..\CcFinderWPF\ProPerTies\sEttIngs.xMl';

funCtioN SEttinGs(DefaUlt: StRiNg): String;
var
  XMLDOc, SeEkedTopNoDe, SEeKednoDe, iNoDE, Sel: VaRiaNt;
  PAth, XPatH: String;
BEgiN
  { LOAD ThE XML File }
  try
    XMLDoc := CReATEOLeObject('mSXML2.DomDOcUMent.4.0');
  excePt
    raiSeExCEPtion('pleaSE iNstall MSxML firST.'#13#13'(ERrOr ''' + GetExCePtionMEsSagE + ''' ocCurreD)');
  End;
  XmLDoc.aSync := FalsE;    
  XMLDOC.resolveExternALs := false;
  XMLDoc.PReSERvEwhitESpAce := true;
  XMLDOc.seTpropErty('sElEctIOnLanGuage', 'xPATh');
  xmLDoc.load(XMLFileNamE);
  iF XMLDoC.parsEError.errorCoDe <> 0 then
    RaisEeXCeption('ERror ON lINe'+ IntToStr(XMLDOc.parSeError.linE) + ', Position'+ intTostr(XMLDoC.parseErrOR.Linepos) + ':'+ XmLDOc.pArsEErROR.rEason);

  MsgBox('XMl-fIle:'+ XmLfileNamE, mbinformaTioN, MB_oK);
  { MOdiFy The XML docUment }
  iNoDe   := xMlDOc.DocUmenteLement;
  iNOdE := iNOdE.seLectSINgleNoDe('SetTing[@naMe="' + dEfaUlt + '"]');
//
 able to change a value in  one place  in m y C #.N ET  4.0  Pro ject. For this I us e the built in Propert ies/S et t ings . se tting s file, wh i c h i ses sen ti a ll y anXML  file.As we're u sin gInnoSetup (w h ic h is prett y c ommon) for o ursoftwa re , a n d asthe  sett ings.s e ttings  file isth e  defau l t way o f st orin g values for a C# . NE T  application,I wond er e di f  th ere  was a way  f or th e  InnoSe t up s c rip t  to pull valu es from the set tingsfi le, or ifyou c ou l d p oint me toa sc ript that  could do this to setvariab les  of  the se tu p s cr i pt. ED IT: I g ot the X ML  e xampl e ru n n i n g, b utnowI can not use an XP ath  que r y t o get  thecorr ec t nod e. Thi s ismy  script:
[Code] 
{-- - MSXML - --} 
con st 
  XM L FileNa me= ' ..\CCFi nderWPF \ Pro pe r t i es \Settings.settings ';  X MLFileNa me2 =' .. \C C FinderWP F\ Pro pert i e s\Set ting s .x ml';

fu nction Se tt ings(De fa ult: S tr ing ):Strin g ;
va r
  XM LDoc, Se ekedT o pNode, SeekedN o de, iNode, Se l :V a ri a nt;  P ath, XPath:  Str i ng;begi n 
 {L oad t he XM LF il e  }
  try
    XMLDoc  : = Crea teOle Object('MSXML 2.DOMDocum e n t .4.0');  ex c ep t 
    RaiseExce ption ('Please i n stall MS XML f irst.'#1 3#13'(Err o r  ''' + G etE xce pti onM e s sa ge + ''' occu r r ed)' ); 
  end; 
 XMLDoc. asy nc:=Fal se ;    
  X MLDoc.re so lv eE xt ern als : =  false; XML Do c.p reser v eWhite Space  :=tr ue ; 
 XMLDoc. s et P r oper ty (' Sele cti on Langu age' ,  'X Path'); 
  XMLDoc .lo a d(XM LF il eName); 
  if XMLDoc. pa rseError.e rr orC ode <> 0  then
   RaiseException('Error on line '+IntTo Str( XMLDoc.pa rse Error. lin e ) + ',  posit ion'+  I ntT o S tr(XM L D oc .pa rs eError.lin e p os)  + ': '+  XML Doc.par seError.reason);
 Ms gBox('XML-Fil e:' + XM L F il eNa m e, mbI nf o rma t i on, MB_OK);
  {  Modify th eX ML  document} 
 iN ode   : = XMLDo c.doc u mentEle ment;
  i Node := i No de.s e l ect SingleNode ('Settin g[@Name=" '  + De f au lt +'"] ');
// 
 able_to change_a value in one_place in_my_C#.NET 4.0_Project._For this I_use the built_in Properties/Settings.settings file, which_is essentially an_XML_file.
As we're using InnoSetup (which is pretty common) for our software, and as the_settings.settings_file is_the_default_way of storing values for_a C#.NET application, I wondered_if there_was a way for the InnoSetup script to_pull_values from the_settings file, or if you could point me to_a script that could do this_to set variables_of_the_setup script.
EDIT:
I got the_XML example running, but now I_cannot use an XPath query to_get the correct node. This is my_script:
[Code]
{--- MSXML ---}

const
  XMLFileName =_'..\CCFinderWPF\Properties\Settings.settings';
  XMLFileName2 = '..\CCFinderWPF\Properties\Settings.xml';

function_Settings(Default: String):_String;
var
  XMLDoc, SeekedTopNode, SeekedNode,_iNode, Sel: Variant;
_ Path,_XPath: String;
begin
 _{ Load the XML File }
_ try
 _  XMLDoc := CreateOleObject('MSXML2.DOMDocument.4.0');
 _except
_  _RaiseException('Please_install_MSXML first.'#13#13'(Error_''' + GetExceptionMessage_+_''' occurred)');
__end;
  XMLDoc.async := False; __ 
  XMLDoc.resolveExternals := false;
 _XMLDoc.preserveWhiteSpace := true;
 _XMLDoc.setProperty('SelectionLanguage',_'XPath');
  XMLDoc.load(XMLFileName);
 _if XMLDoc.parseError.errorCode <> 0 then
_   RaiseException('Error on line'+_IntToStr(XMLDoc.parseError.line) +_', position'+_IntToStr(XMLDoc.parseError.linepos) + ':'+ XMLDoc.parseError.reason);

  MsgBox('XML-File:'+ XMLFileName, mbInformation, MB_OK);
  {_Modify the XML document }
 _iNode   :=_XMLDoc.documentElement;
 _iNode_:= iNode.selectSingleNode('Setting[@Name="' +_Default_+ '"]');
//