I'm trying to use nsisXML to replace data in a tomcat configuration file. I've just started with nsis and most of it makes sense, this last piece in modifying the xml files is escaping me. I would have liked to use a find/replace script, but I need to replace specific variables and not all of them.
This script keeps crashing at the colored line. Any assistance you could offer would be appreciated.
Function GetTomcatData
!insertmacro MUI_HEADER_TEXT $(PAGE_TITLE) $(PAGE_SUBTITLE)
Var /GLOBAL AppUrl
Var /GLOBAL AppUrlState
nsDialogs::Create 1018
${NSD_CreateLabel} 10% 15u 80% 12u "Enter Application FQDN (e.g. www.server.com)"
${NSD_CreateText} 10% 25u 80% 14u $AppUrlState
Pop $AppUrl
nsDialogs::Show
FunctionEnd
Function GetTomcatDataLeave
${NSD_GetText} $AppUrl $AppUrlState
nsisXML::create
nsisXML::load "C:\tomcat6\conf\server.xml"
nsisXML::select '/Server/Service/Engine/Host[@name="localhost"]'
nsisXML::getAttribute "name"
nsisXML::getText
nsisXML::setText $AppUrl
nsisXML::save "C:\tomcat6\conf\server.xml"
FunctionEnd
This script keeps crashing at the colored line. Any assistance you could offer would be appreciated.
Function GetTomcatData
!insertmacro MUI_HEADER_TEXT $(PAGE_TITLE) $(PAGE_SUBTITLE)
Var /GLOBAL AppUrl
Var /GLOBAL AppUrlState
nsDialogs::Create 1018
${NSD_CreateLabel} 10% 15u 80% 12u "Enter Application FQDN (e.g. www.server.com)"
${NSD_CreateText} 10% 25u 80% 14u $AppUrlState
Pop $AppUrl
nsDialogs::Show
FunctionEnd
Function GetTomcatDataLeave
${NSD_GetText} $AppUrl $AppUrlState
nsisXML::create
nsisXML::load "C:\tomcat6\conf\server.xml"
nsisXML::select '/Server/Service/Engine/Host[@name="localhost"]'
nsisXML::getAttribute "name"
nsisXML::getText
nsisXML::setText $AppUrl
nsisXML::save "C:\tomcat6\conf\server.xml"
FunctionEnd
Comment