[英]copy variables in NSIS
I am using nsisXML by Wizou to read and write from XML configuration file.我正在使用 Wizou 的 nsisXML 从 XML 配置文件中读取和写入。 In uninstaller, I'd like to report back which version was uninstalled.在卸载程序中,我想报告卸载了哪个版本。 There are multiple parts of my app, each with a version string.我的应用程序有多个部分,每个部分都有一个版本字符串。
This is how I report back:这就是我报告的方式:
inetc::post '{"extra":{"app1":"$u_app1","app2":"$u_app2", "app3":"$u_app3", "app4":"$u_app4", "app5":"$u_app5" }}' /SILENT /HEADER "Content-Type: application/json" "https://myurl.com/uninstalled" /CONNECTTIMEOUT -5
The problem with nsisXML, is that it writes to nsis registers $0, $1, $2, $3 and so on.. If I read from multiple nodes, the return value is stored in $3 for all and is being overwriten with each read. nsisXML 的问题在于它写入 nsis 寄存器 $0、$1、$2、$3 等等。如果我从多个节点读取,则返回值存储在 $3 中,并且每次读取都会被覆盖。
nsisXML::create
nsisXML::load "conf.dont.touch.xml"
nsisXML::select "/data/app1"
nsisXML::getText ;stored in $3
nsisXML::select "/data/app2"
nsisXML::getText ;stored in $3
nsisXML::select "/data/app3"
nsisXML::getText ;stored in $3
nsisXML::select "/data/app4"
nsisXML::getText ;stored in $3
nsisXML::select "/data/app5"
nsisXML::getText ;stored in $3
need $u_app1, $u_app2,$u_app3,$u_app4,$u_app5 at the same time
inetc::post '{"extra":{"app1":"$u_app1","app2":"$u_app2", "app3":"$u_app3", "app4":"$u_app4", "app5":"$u_app5" }}' /SILENT /HEADER "Content-Type: application/json" "https://myurl.com/uninstalled" /CONNECTTIMEOUT -5
How do I copy $3
in to a $R1
or any custom variable so I can use it a later time?如何将$3
复制到$R1
或任何自定义变量中,以便以后使用?
Variables are just strings so you can copy them as a string:变量只是字符串,因此您可以将它们复制为字符串:
var whatever
Section
StrCpy $R1 $3
StrCpy $whatever $3
SectionEnd
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.