简体   繁体   English

Device Stage Visual Editor要求

[英]Device Stage Visual Editor requirements

Using the device stage visual editor tool, the task requirements only takes xml however I need the requirement to be if this program is installed on the computer then return true else false; 使用设备阶段可视化编辑器工具,任务要求仅采用xml,但是我需要这样的条件:如果此程序已安装在计算机上,则返回true,否则返回false;否则,返回true。

<script language="JavaScript">
    <![CDATA[
        function hasProgram()
        {
            if(file.exists(c:\program files (x86)\company\program\program.exe)
            {
                return 1;
            }
            else
            {
                return 0;
            }
        }
    ]]>
</script>

I got the previous code from a website but it doesn't work and from what I can work out from other websites is this is not doable using the Javascript inside the xml however it is clear that some devices do have something like this at the device stage. 我从网站上获得了先前的代码,但是它无法正常工作,并且从其他网站上可以得出的结论是,使用xml中的Javascript无法做到这一点,但是很明显,某些设备在设备上确实具有类似的功能阶段。

so my question is the part that is in correct the if statement line and if it is how do I fix it? 所以我的问题是正确的if语句行的部分,以及如何解决该问题?

If you add a registry key when installing the program so it runs when you type a set command into the run command(windows+r) you can then just check if that registry exists in raw xml and get the exact path even if it is installed in a different location. 如果在安装程序时添加注册表项,以便在运行命令(windows + r)中键入set命令时它可以运行,则只需检查该注册表是否存在于原始xml中,即使安装了该注册表也可以获得确切的路径在不同的位置。

use the ifRegistryExist command to do this 使用ifRegistryExist命令执行此操作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM