wix SetProperty Before ='AppSearch' [英] wix SetProperty Before='AppSearch'

查看:115
本文介绍了wix SetProperty Before ='AppSearch'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何更改日期和时间格式?我需要及时将:替换为 _。
在我的代码下方:

How i can change date and time format? I need replace ":" to "_" in time. Below my code:

<SetProperty Before='AppSearch' Sequence='both' Id='HOSTNAME' Value="[ComputerName]_[Time]_[Date]">NOT HOSTNAME</SetProperty>


推荐答案

MSI SDK 文档很好:时间属性

值的格式取决于用户的语言环境,并且是使用 GetTimeFormat 函数和 TIME_FORCE24HOURFORMAT |获得的格式。 TIME_NOTIMEMARKER 选项。

The format of the value depends upon the user's locale, and is the format obtained using GetTimeFormat function with the TIME_FORCE24HOURFORMAT | TIME_NOTIMEMARKER option.

因此用户的语言环境会影响格式,然后您可能需要使用自定义操作来获取格式化所需的方式。我想不出其他方法。

So the user's locale will affect the format, and then you probably need to use a custom action to get the formatting the way you want it. I can't think of any other way to do it.

所有时间最短的VBScript :(

All time silliest VBScript: (it is very late)

MsgBox Day(Now) & "_" & Month(Now) & "_" & Year(Now) & "_" & Hour(Now) & "_" & Minute(Now) & "_" & Second(Now)

在这里可以找到有关如何插入自定义操作的提示:如何在安装时执行条件自定义操作并仅修改?

And just a hint for how to insert custom actions can be found here: How to execute conditional custom action on install and modify only?

  • https://ss64.com/vb/syntax-getdatetime.html
  • https://ss64.com/vb/syntax-getdate.html
  • https://www.w3schools.com/asp/asp_ref_vbscript_functions.asp
  • How do I get the Date & Time (VBS)

这篇关于wix SetProperty Before ='AppSearch'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆