首页 \ 问答 \ 如何防止在InstallShield中记录自定义操作的执行步骤?(How to prevent to log execution steps of Custom Action in InstallShield?)

如何防止在InstallShield中记录自定义操作的执行步骤?(How to prevent to log execution steps of Custom Action in InstallShield?)

我使用InstallShield制作了一个安装程序。 我已经写了一些自定义操作。
安装此安装程序时,这些CustomActions的日志(执行步骤)将打印在日志文件中。 但我想阻止将一些CustomActions的数据(执行步骤)记录到日志文件中。 我不想让用户知道Custom Action出于安全目的究竟做了什么。

那么如何防止一些CustmAction将其执行步骤记录到日志文件中呢? 我想阻止整个CustomAction的日志。
或者我们可以在InstallShield中安装时暂停一段时间的日志记录吗?


I have made one installer using InstallShield. I have written some Custom Actions in that.
While installing this installer, the logs (execution steps) of those CustomActions gets printed in log file. But I want to prevent to log some CustomActions's data (execution steps) into log file. I don't want to let user know what exactly the Custom Action is doing for security purpose.

So how I can prevent some CustmAction to log their execution steps into log files ? I want to prevent whole CustomAction's logs.
Or can we pause a logging for some duration time while installation in InstallShield ?


原文:https://stackoverflow.com/questions/38617646
更新时间:2021-06-28 15:06

最满意答案

尝试:

function QueryStock($cat) {
    $query = "SELECT * FROM stock WHERE catno = " . $cat;
    global $wpdb;
    $row = $wpdb->get_row($query);
        $catno = $row->catno; //Column name in table
        $itemname = $row->itemname; //Column name in table
        $price = $row->price; //Column name in table
        $stock = $row->stock; //Column name in table

    echo "There are " . $stock . " bears";
}

另外,我建议不要使用“SELECT *”。 尝试仅查询使用的列。 这对性能更好。

编辑:看到一个错字。 您的代码中有“$ catno == $ row ...”。 你应该只使用一个“=”


Eureka!!!,

It's often something missed, and it was in the MySQL query.

The query should be SELECT * FROM stock WHERE catno = '$cat' making $query = "SELECT * FROM stock WHERE catno = '$cat'";

I have taken on board the "SELECT *" issue @eckes and @rickonline pointed out, went for separate queries and used $wpdb->get_var().

Working coding is..

function QueryStock($cat) {
    $query1 = "SELECT catno FROM stock WHERE catno = '$cat'";
    $query2 = "SELECT itemname FROM stock WHERE catno = '$cat'";
    $query3 = "SELECT price FROM stock WHERE catno = '$cat'";
    $query4 = "SELECT stock FROM stock WHERE catno = '$cat'";

    global $wpdb;

    $catno = $wpdb->get_var($query1);
    $itemname = $wpdb->get_var($query2);
    $price = $wpdb->get_var($query3);
    $stock = $wpdb->get_var($query4);

    echo "There are " . $stock . " bears";
}

相关问答

更多
  • WordPress是个开发的基于PHP的博客系统,有强大的管理界面,必须要有服务器的支持,如果想自己建个独立博客,WordPress无疑是最好的选择。有问题请追问。
  • mysql_ *已被弃用,现在它不适用于较新版本的Php。 建议: 使用PHP 5.3+或5.4+(PHP 5.5+ PHP 5.6+ PHP 7.0+ PHP 7.1+现在不支持)。 或者对WordPress 4.4使用mysqli_*扩展名。 或者在最后一次更改查询中按照wordpress $wpdb->get_row 。 PHP不支持的分支 WordPress论坛 Wpdb类参考: mysql_* has been deprecated and now its not available in new ...
  • 每页590次查询负载非常高。 很可能你在某个地方有一个循环,它每次都在进行查询,而不是执行单个查询,缓存结果,然后处理缓存的结果。 另外,看看这些: mysql查询太多了 减少具有相同结果的查询 查找和修复慢速WordPress数据库查询 加快你的wordpress博客 590 queries per page load is insanely high. Most likely you have a loop somewhere which is doing a query each time throu ...
  • 尝试: function QueryStock($cat) { $query = "SELECT * FROM stock WHERE catno = " . $cat; global $wpdb; $row = $wpdb->get_row($query); $catno = $row->catno; //Column name in table $itemname = $row->itemname; //Column name in table ...
  • 我相信这就是你的意思: select distinct t1.* from t1 LEFT JOIN t2 on [condition for join] and t2.column="something" where [t1 conditions]. 这假设您只对t1字段感兴趣。 我们不知道的是: 表模式 他们是如何加入的? t2.t1_id = t1.id ? t1条件 如果连接有多个匹配项,则上面使用的DISTINCT将消除重复行 编辑(OP评论回复): SELECT distinct post ...
  • 您的联接正确完成。 删除你的评论和额外的行时,你会发现查询并不那么复杂。 我做的唯一真正的改变是将wp_terms.slug的OR列表更改为IN语句。 这样做只是为了减少代码重复,清理外观,而不是改变功能。 SELECT p.post_content, p.ID, t.slug FROM wp_posts AS p INNER JOIN wp_postmeta AS pm ON p.ID = pm.post_id INNER JOIN wp_term_relationships AS tr ON p.ID ...
  • 通过将类别ID或类别名称传递给http://codex.wordpress.org/Template_Tags/query_posts ,使用query_posts函数。 这一切都在链接上解释。 在您的评论后编辑: 你也可以使用get_posts http://codex.wordpress.org/Template_Tags/get_posts,AFAIK它们都返回数组。 $posts = get_posts('category=1'); foreach($posts as $post) { ec ...
  • 您是否尝试在两个查询上运行EXPLAIN以查看延迟的位置? 另外,检查正在连接的表是否有索引。 EXPLAIN会告诉您查询是否实际使用索引。 Have you tried running an EXPLAIN on the two queries to see where the delays are? Also, check whether there are indexes on the tables being joined. The EXPLAIN would tell you whether th ...
  • 这是答案的更新版本,比上一版更灵活。 这是使用SQL UNION的一个想法: 我们可以使用posts_clauses过滤器中的数据来重写posts_clauses过滤器中的SQL查询。 我们扩展WP_Query类来实现我们的目标。 我们实际上做了两次: WP_Query_Empty :获取生成的每个子查询的SQL查询,但不做数据库查询。 WP_Query_Combine :获取帖子。 以下实现支持组合N个子查询。 这里有两个演示: 演示#1: 假设您有六个帖子,按日期排序(DESC): CCC AAA BB ...

相关文章

更多

最新问答

更多
  • 如何检索Ember.js模型的所有属性(How to retrieve all properties of an Ember.js model)
  • maven中snapshot快照库和release发布库的区别和作用
  • arraylist中的搜索元素(Search element in arraylist)
  • 从mysli_fetch_array中获取选定的值并输出(Get selected value from mysli_fetch_array and output)
  • Windows Phone上的可用共享扩展(Available Share Extensions on Windows Phone)
  • 如何在命令提示符下将日期设置为文件名(How to set file name as date in command prompt)
  • 如何在Laravel 5.2中使用paginate与关系?(How to use paginate with relationships in Laravel 5.2?)
  • 从iframe访问父页面的id元素(accessing id element of parent page from iframe)
  • linux的常用命令干什么用的
  • Feign Client + Eureka POST请求正文(Feign Client + Eureka POST request body)
  • 怎么删除禁用RHEL/CentOS 7上不需要的服务
  • 为什么Gradle运行测试两次?(Why does Gradle run tests twice?)
  • 由于有四个新控制器,Auth刀片是否有任何变化?(Are there any changes in Auth blades due to four new controllers?)
  • 如何交换返回集中的行?(How to swap rows in a return set?)
  • 在android中的活动之间切换?(Switching between activities in android?)
  • Perforce:如何从Depot到Workspace丢失文件?(Perforce: how to get missing file from Depot to Workspace?)
  • Webform页面避免运行服务器(Webform page avoiding runat server)
  • 在ios 7中的UITableView部分周围绘制边界线(draw borderline around UITableView section in ios 7)
  • 内存布局破解(memory layout hack)
  • 使用Boost.Spirit Qi和Lex时的空白队长(Whitespace skipper when using Boost.Spirit Qi and Lex)
  • 我们可以有一个调度程序,你可以异步添加东西,但会同步按顺序执行吗?(Can we have a dispatcher that you can add things todo asynchronously but will be executed in that order synchronously?)
  • “FROM a,b”和“FROM a FULL OUTER JOIN b”之间有什么区别?(What is the difference between “FROM a, b” and “FROM a FULL OUTER JOIN b”?)
  • Java中的不可变类(Immutable class in Java)
  • bat批处理文件结果导出到txt
  • WordPress发布查询(WordPress post query)
  • 如何在关系数据库中存储与IPv6兼容的地址(How to store IPv6-compatible address in a relational database)
  • 是否可以检查对象值的条件并返回密钥?(Is it possible to check the condition of a value of an object and JUST return the key?)
  • 德州新起点计算机培训学校主要课程有什么?
  • GEP分段错误LLVM C ++ API(GEP segmentation fault LLVM C++ API)
  • “latin1_german1_ci”整理来自哪里?(Where is “latin1_german1_ci” collation coming from?)