帮助中心 helper



NsisXML插件使用

发布于:2017-05-11 16:55 编辑:Surou  浏览:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
        nsisXML::create
        nsisXML::createProcessingInstruction "xml" 'version="1.0" standalone="yes"'
        nsisXML::appendChild
        nsisXML::createElement "configuration"        ; create main document element node
        nsisXML::appendChild
        StrCpy $1 $2                        ; lets move to this node and create its childs:
        nsisXML::createElement "appSettings"
        nsisXML::appendChild
        StrCpy $1 $2
        nsisXML::createElement "add"
        nsisXML::setAttribute "key" "Platform"
        nsisXML::setAttribute "value" "平板"
        nsisXML::setText ""
        nsisXML::appendChild
        nsisXML::createElement "add"
        nsisXML::setAttribute "key" "ServiceIP"
        nsisXML::setAttribute "value" "192.168.1.105"
        nsisXML::setText ""
        nsisXML::appendChild
        nsisXML::createElement "add"
        nsisXML::setAttribute "key" "ServicePort"
        nsisXML::setAttribute "value" "13500"
        nsisXML::setText ""
        nsisXML::appendChild
        nsisXML::createElement "add"
        nsisXML::setAttribute "key" "ClientPort"
        nsisXML::setAttribute "value" "13501"
        nsisXML::setText ""
        nsisXML::appendChild
        nsisXML::save "Sample.xml"

创建的XML如下:

文章来源:nsisfans