wix SetProperty Before ='AppSearch' [英] 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
- < a href = https://ss64.com/vb/syntax-getdate.html rel = nofollow noreferrer> https://ss64.com/vb/syntax-getdate.html
- https://www.w3schools.com/asp/asp_ref_vbscript_functions.asp
- 如何获取日期和日期?时间(VBS)
- 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屋!