Wix Project Installer Version Issue

97 Views Asked by At

We have a old wix project which creates a installer (excel add in) which has been moved to use yaml pipeline but now the installer is getting created in the folder 1.0.0.0 instead of the next version

I have been struggling to understand from where is it been driven as I cannot find anything from the repository.

I have also made a small edit on the powershell script which I thought was responsible but it had no effect

- powershell: |
          $versions = [xml](Get-Content '$(PublishLocation)\version_info.xml')
          $lastChild = $versions.application.product.LastChild
          $versions.application.product.RemoveChild($lastChild)
          $latest_version = $versions.application.product.LastChild.name
          
          Write-Host "##vso[task.setvariable variable=MSIVersion;]$latest_version"
          Write-Host "Set MSIVersion variable to ($latest_version)"
        displayName: 'Parse installed MSI version'

I added the remove last child bit and I see the right version but still the installer goes and sits in the 1.0.0.0 folder

I am also confused about the version_info xml which is being read, I do not see it in the solution. A web.config however has the following entry:

<add wildcard="/devxls/version_info.xml" destination="/excel-add-in/version_info.xml" />

So basically I need the new folder which is getting created to have the correction version number as its name and the new installer to get created inside that.

Please let me know if some other information is also required as I have never worked on this type of project so it is fairly new to me.

Edit 1: Yaml build and release

stages:
- stage: Build
  jobs:
  - job: Build
    displayName:
    pool:
      name: 
    steps:
    - checkout: self

    - task: NuGetToolInstaller@1
      inputs:
        versionSpec: 5.7.0

    - task: NuGetAuthenticate@1

    - task: NuGetCommand@2
      displayName: 'NuGet restore'
      inputs:
        vstsFeed: ''

    - task: SonarSource.sonarqube.15B84CA1-B62F-4A2A-A403-89B77A063157.SonarQubePrepare@4
      inputs:
        SonarQube: 
        projectKey: ''
        projectName: ''
      continueOnError: true

    - task: colinsalmcorner.colinsalmcorner-buildtasks.version-assemblies-task.VersionAssemblies@2
      displayName: 'Version Assemblies'
      inputs:
        sourcePath: (solution name)
        versionFormat: threeParts
        replaceVersionFormat: threeParts

    - task: VSBuild@1
      displayName: 'Build WIX Project'
      inputs:
        solution: wixproject path
        msbuildArgs: ''
        configuration: ''
        clean: true

    - task: VisualStudioTestPlatformInstaller@1
      inputs:
        versionSelector: latestStable

    - task: VSTest@2
      displayName: ''
      inputs:
        testAssemblyVer2: |
          
          testFiltercriteria: ''
          vsTestVersion: toolsInstaller

    - task: SonarSource.sonarqube.6D01813A-9589-4B15-8491-8164AEB38055.SonarQubeAnalyze@4
      displayName: 'Run Code Analysis'
      continueOnError: true

    - task: SonarSource.sonarqube.291ed61f-1ee4-45d3-b1b0-bf822d9095ef.SonarQubePublish@4
      displayName: 'Publish Quality Gate Result'
      continueOnError: true

    - task: PublishSymbols@2
      displayName: 'Publish symbols path'
      inputs:
        SymbolServerType: TeamServices

    - task: CopyFiles@2
      displayName: 'Copy Files to: $(Build.StagingDirectory)\drop'
      inputs:
        Contents: |
          
        
        TargetFolder: '$(Build.StagingDirectory)\drop'
        CleanTargetFolder: true
        flattenFolders: true

    - task: PublishBuildArtifacts@1
      displayName: 'Publish Artifact: drop'
      inputs:
        PathtoPublish: '$(Build.StagingDirectory)\drop'

- template: ./env.yml
  parameters:
    env: 
    dependsOn: Build    
    //other parameters

env.yml

parameters:
- name: env
  type: string
  

stages:
- stage: 
  dependsOn: 
  condition: 
  displayName: 
  variables:   
    
  
  pool:
    name: 
  jobs:
  - deployment: InstallIIS
    displayName: 
    pool:
      name: 
    environment: 
      name: 
    strategy:
      runOnce:
        deploy:
          steps:
            - checkout:
              path: ''

            - task: PowerShell@2
              inputs:
                targetType: filePath
                filePath: ''
                arguments: ''

            - task: PowerShell@2
              inputs:
                targetType: filePath
                filePath: 'powershell script path'
                arguments: ''

            - task: IISWebAppManagementOnMachineGroup@0
              displayName: 'Manage Root'
              inputs:
                EnableIIS: true
                WebsiteName: ''
                WebsitePhysicalPath: ''
                WebsitePhysicalPathAuth: WebsiteWindowsAuth
                WebsiteAuthUserName: ''
                WebsiteAuthUserPassword: 
                AddBinding: true
                Bindings: ''
                CreateOrUpdateAppPoolForWebsite: true
                ConfigureAuthenticationForWebsite: true
                AppPoolNameForWebsite: ''
                AnonymousAuthenticationForWebsite: true
                WindowsAuthenticationForWebsite: false

            - task: IISWebAppManagementOnMachineGroup@0
              displayName: 'Manage App'
              inputs:
                EnableIIS: true
                IISDeploymentType: IISWebApplication
                ParentWebsiteNameForApplication: ''
                VirtualPathForApplication: ''
                PhysicalPathForApplication: ''
                ApplicationPhysicalPathAuth: ApplicationWindowsAuth
                ApplicationAuthUserName: ''
                ApplicationAuthUserPassword: ''
                CreateOrUpdateAppPoolForApplication: true
                AppPoolNameForApplication: ''

  - job: InstallMSI
    dependsOn: InstallIIS
    displayName: Install MSI
    steps:
      - download: current
        artifact: drop
              
      - task: qetza.replacetokens.replacetokens-task.replacetokens@3
        displayName: 'Replace tokens in adxpublisher.config'
        inputs:
          rootDirectory: '$(Pipeline.Workspace)/drop'
          targetFiles: adxpublisher.config
          actionOnMissing: fail
          tokenPrefix: '__'
          tokenSuffix: '__'

      - script: '"$(adx.path)\Adxpublisher.exe" /OutputType=ClickTwice /ConfigFile=./adxpublisher.config'
        workingDirectory: '$(Pipeline.Workspace)/drop'
        failOnStderr: true
        displayName: 'Deploy MSI'

      - powershell: |
          $versions = [xml](Get-Content '$(PublishLocation)\version_info.xml')
          $lastChild = $versions.application.product.LastChild
          $versions.application.product.RemoveChild($lastChild)
          $latest_version = $versions.application.product.LastChild.name
          
          Write-Host "##vso[task.setvariable variable=MSIVersion;]$latest_version"
          Write-Host "Set MSIVersion variable to ($latest_version)"
        displayName: 'Parse installed MSI version'

      - task: qetza.replacetokens.replacetokens-task.replacetokens@3
        displayName: 'Replace tokens in web.config'
        inputs:
          rootDirectory: '$(Pipeline.Workspace)/drop'
          targetFiles: web.config
          actionOnMissing: fail
          tokenPrefix: '__'
          tokenSuffix: '__'

      - task: CopyFiles@2
        displayName: 'Copy web.config'
        inputs:
          SourceFolder: '$(Pipeline.Workspace)/drop'
          Contents: web.config
          TargetFolder: '$(PublishLocationRoot)'
          OverWrite: true

Edit 2:

enter image description here

0

There are 0 best solutions below