Hello,
I’am writing a installer which must insert a line in a given configuration file called “protege.propertiesâ€
The differents directories in file path must be separated with “\\†(double slash) (according this kind of configuration file syntaxe)
I’ve got the beginning of the path in the $INSTDIR variable be with only “\†(see following code)
============================================================
Section "GraphViz (2.8)"
…
FileOpen $0 $INSTDIR\applications\protege\protege.properties a
FileWrite $0 "dot.command="
FileWrite $0 $INSTDIR
FileWrite $0 "\\Graphviz\\bin\\dot.exe"
FileClose $0
SectionEnd
============================================================
I’ve got a compiler error (using the ${wordReplace} function) with this code :
============================================================
Section "GraphViz (2.8)"
…
${WordReplace} $INSTDIR "\" "\\" $modifiedInstDir
FileOpen $0 $INSTDIR\applications\protege\protege.properties a
FileWrite $0 "dot.command="
FileWrite $0 $modifiedInstDir
FileWrite $0 "\\Graphviz\\bin\\dot.exe"
FileClose $0
SectionEnd
============================================================
Any one could show me a sample of rigth piece of code ?
Regards
Eipimun
Help : How to replace character in a string ?
4 posts
I think there's a macro in the documents.
I think you are missing a parameter.
E.3.8 WordReplaceYou are doing:
${WordReplace} "[string]" "[word1]" "[word2]" "[E][options]" $var
${WordReplace} $INSTDIR "\" "\\" $modifiedInstDirwhen it should be${WordReplace} $INSTDIR "\" "\\" "OPTIONS" $modifiedInstDirI am doing a line almost exactly like yours, only it reads:${WordReplace} $INSTDIR "\" "\\" "E+" $modifiedInstDirTry that.Thank you for your 2 replies : it works now !
Thanks again
Eipimun
Thanks again
Eipimun