短篇小说:有没有办法指定日志文件的位置,而不是在开头将其作为参数传递?如果不是,我如何将参数传递给运行嵌入式(在更新时)的包?
长篇故事:为了避免用户要求为每次更新提供管理员权限,我们为他们提供了安装$attachment = file_get_contents($path_certificate.$certificate_filename);
$attachment_encoded = base64_encode($attachment);
$params = array(
'html' => $message,
"text" => null,
"from_email" => $from,
"from_name" => "Admin",
"subject" => $subject,
"to" =>array(array('email' => $to )),
"track_opens" => true,
"track_clicks" => true,
"auto_text" => true,
"attachments" => array(
array(
'content' => $attachment_encoded,
'type' => "application/pdf",
'name' => $certificate_filename,
)
)
);
的选项。此ElevationService
运行为Service
,用于自动启动我们的新捆绑包,并SYSTEM
权限进行安装。在这种情况下,我们将参数SYSTEM
传递给新的bundle以确保将日志写入正确的路径。默认情况下会使用-log <path>
,我们不希望这样。到现在为止还挺好!但是在捆绑更新结束时,旧捆绑包将被卸载。这是嵌入式完成的,因此嵌入式安装实例的日志文件将被写入默认路径(C:\Windows\Temp
)。有没有办法改变这种状况?
答案 0 :(得分:1)
如果您使用的是Bundle,请查看:
<Log Prefix="path-to-log-file-here" />