最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

semantic versioning - Is there a way to check a string variable length in wix? - Stack Overflow

programmeradmin3浏览0评论

so my .wxi file has these:

<?define MajorVersion="2" ?>
<?define MinorVersion="0" ?>
<?define BuildVersion="1" ?>

<?define PreRelease="a" ?>
<?define BuildMeta="" ?>

and I'd like to set the sementic version string depending if the PreRelease or BuildMeta strings are set. is this possible? The below doesn't work but i'd like to do something like this.

  <?if $(var.PreRelease.Length) -gt 0 ?>
     <?define SemVer = "$(var.MajorVersion).$(var.MinorVersion).$(var.BuildVersion)-$(var.PreRelease)"?>
     <?if $(var.BuildMeta) ?>
        <?if $(var.BuildMeta.Length) -gt 0 ?>
           <?define SemVer = "$(var.MajorVersion).$(var.MinorVersion).$(var.BuildVersion)-$(var.PreRelease)+$(var.BuildMeta)"?>
        <?endif?>
     <?endif?>
  <?endif?>
发布评论

评论列表(0)

  1. 暂无评论