如何防止在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,怎么使用...?

WordPress是个开发的基于PHP的博客系统,有强大的管理界面,必须要有服务器的支持,如果想自己建个独立博客,WordPress无疑是最好的选择。有问题请追问。

Wordpress没有执行mysql_query()(Wordpress not executing mysql_query())

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 i...

有多少Wordpress数据库查询是正常的?(How many Wordpress database queries is normal?)

每页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 ...

Wordpress中的mySQL查询(mySQL Queries in Wordpress)

尝试: 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 ta...

MySQL条件连接查询(WordPress数据库)(MySQL Conditional Join Queries (WordPress DB))

我相信这就是你的意思: 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...

使用JOIN在Wordpress中进行高级MySQL查询(Advanced MySQL query in Wordpress with JOIN)

您的联接正确完成。 删除你的评论和额外的行时,你会发现查询并不那么复杂。 我做的唯一真正的改变是将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 ...

需要帮助MySQL查询Wordpress(Need help with MySQL query for Wordpress)

通过将类别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) { ...

Wordpress的事件日历插件 - 非常慢的MySQL查询?(Event Calendar plugin for Wordpress - very slow MySQL queries?)

您是否尝试在两个查询上运行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 wheth...

Wordpress结合查询(Wordpress combine queries)

这是答案的更新版本,比上一版更灵活。 这是使用SQL UNION的一个想法: 我们可以使用posts_clauses过滤器中的数据来重写posts_clauses过滤器中的SQL查询。 我们扩展WP_Query类来实现我们的目标。 我们实际上做了两次: WP_Query_Empty :获取生成的每个子查询的SQL查询,但不做数据库查询。 WP_Query_Combine :获取帖子。 以下实现支持组合N个子查询。 这里有两个演示: 演示#1: 假设您有六个帖子,按日期排序(DESC): CCC A...

相关文章

更多

upgrade steps

3 solr instance :solr1/solr2/solr3 2 collection:col ...

action 线程问题。

比如现在有个Action,叫CZaction,有很多用户会访问这个action,这个action有对数 ...

Solr In Action

1. solr.xml – Defines one or more cores per Solr se ...

Solr: a custom Search RequestHandler

As you know, I've been playing with Solr lately, tr ...

Hadoop0.20+ custom MultipleOutputFormat

Hadoop0.20.2中无法使用MultipleOutputFormat,多文件输出这个方法。尽管0 ...

log4j快速入门示例

log4j.appender.FILE.layout=org.apache.log4j.Pattern ...

Commons log记录Log日志

Commons log 通用Log处理,它是一个接口抽象,底层的实现可以自动替换:如果当前存在log4 ...

[How to] Make custom search with Nutch(v 1.0)?(转)

http://puretech.paawak.com/2009/04/29/how-to-make-c ...

Log4j 记录Log日志

Log4j基本概念 Log4j比JDK Logging更加成熟。Log4j是事实上 日志记录标准。三大 ...

页面获取ACTION的属性,页面不能弹出JS

action定义一个属性,get set后 对属性赋值,值是JS,页面用<s:property/ ...

最新问答

更多

获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)

我用Google搜索了一个解决方案。 “EnumDisplayModeProvider”是我自己设置网站的各种模式的枚举。 public EnumDisplayModeProvider GetDisplayModeId() { foreach (var mode in DisplayModeProvider.Instance.Modes) if (mode.CanHandleContext(HttpContext)) {

如何通过引用返回对象?(How is returning an object by reference possible?)

这相对简单:在类的构造函数中,您可以分配内存,例如使用new 。 如果你制作一个对象的副本,你不是每次都分配新的内存,而是只复制指向原始内存块的指针,同时递增一个也存储在内存中的引用计数器,使得每个副本都是对象可以访问它。 如果引用计数降至零,则销毁对象将减少引用计数并仅释放分配的内存。 您只需要一个自定义复制构造函数和赋值运算符。 这基本上是共享指针的工作方式。 This is relatively easy: In the class' constructor, you allocate m

矩阵如何存储在内存中?(How are matrices stored in memory?)

正如它在“熵编码”中所说的那样,使用Z字形图案,与RLE一起使用,在许多情况下,RLE已经减小了尺寸。 但是,据我所知,DCT本身并没有给出稀疏矩阵。 但它通常会增强矩阵的熵。 这是compressen变得有损的点:输入矩阵用DCT传输,然后量化量化然后使用霍夫曼编码。 As it says in "Entropy coding" a zig-zag pattern is used, together with RLE which will already reduce size for man

每个请求的Java新会话?(Java New Session For Each Request?)

你是如何进行重定向的? 您是否事先调用了HttpServletResponse.encodeRedirectURL()? 在这里阅读javadoc 您可以使用它像response.sendRedirect(response.encodeRedirectURL(path)); The issue was with the path in the JSESSIONID cookie. I still can't figure out why it was being set to the tomca

css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)

我认为word-break ,如果你想在一个单词中打破行,你可以指定它,这样做可以解决问题: .column { word-break:break-all; } jsFiddle演示。 您可以在此处阅读有关word-break属性的更多信息。 I think word-break, with which you can specify if you want to break line within a word, will do the trick: .column { word-break

无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)

我认为您忘记在分类时间内缩放输入图像,如train_test.prototxt文件的第11行所示。 您可能应该在C ++代码中的某个位置乘以该因子,或者使用Caffe图层来缩放输入(请查看ELTWISE或POWER图层)。 编辑: 在评论中进行了一次对话之后,结果发现在classification.cpp文件中错误地删除了图像均值,而在原始训练/测试管道中没有减去图像均值。 I think you have forgotten to scale the input image during cl

xcode语法颜色编码解释?(xcode syntax color coding explained?)

转到: Xcode => Preferences => Fonts & Colors 您将看到每个语法高亮颜色旁边都有一个简短的解释。 Go to: Xcode => Preferences => Fonts & Colors You'll see that each syntax highlighting colour has a brief explanation next to it.

在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)

你考虑过第三方拼写检查吗? 您可以将在C#中开发的自定义WinForms控件插入访问数据库吗? VB6控件怎么样? 如果你能找到一个使用第三方库进行拼写检查的控件,那可能会有效。 Have you considered a third party spell checker? Can you insert a custom WinForms controls developed in C# into an access database? What about a VB6 control? If

从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)

我有同样的问题,因为我在远程服务器上有两个图像,我需要在每天的预定义时间复制到我的本地服务器,这是我能够提出的代码... try { if(@copy('url/to/source/image.ext', 'local/absolute/path/on/server/' . date("d-m-Y") . ".gif")) { } else { $errors = error_get_last(); throw new Exception($err

从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))

我不确定我完全明白你在说什么。 你能编辑你的帖子并包含你正在做的Subversion命令/操作的特定顺序吗? 最好使用命令行svn客户端,以便容易为其他人重现问题。 如果您只是想获取文件的旧副本(即使该文件不再存在),您可以使用如下命令: svn copy ${repo}/trunk/moduleA/file1@${rev} ${repo}/trunk/moduleB/file1 其中${repo}是您的存储库的URL, ${rev}是您想要的文件的版本。 这将恢复该文件的旧版本,包括最高版本