Looking for Help for generating .MSI on GITLAB Linux docker container

venkata gourisetty 0 Reputation points
2023-04-01T02:12:18.6066667+00:00

Hi All, Good Morning/Evening! As a part of User Story, I need to generate a .MSI out of 3 Projects in .net and facing Issues in GITLAB CI/CD Pipeline.

GitLAB CI/CD pipeline will run these 3 Projects in GitLab runner and as we do no have ADMIN privileges for GITLAB, I am facing issues with one of the Project to run one of the project on Linux Docker Container(GitLab runner). Basically i was looking for Windows Docker Container for GITLAB Runner.

As an aletrnate Solution,In Local i was able to do it using Python and generate .MSI but facing issues when i run the same on GITLAB CI/CD Pipeline.

Any inputs and suggestions are highly Apprecited.

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
38,958 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sedat SALMAN 13,820 Reputation points
    2023-04-01T04:20:49.4133333+00:00

    an alternative approach to Windows-based container

    1. Use the .NET Core cross-platform tools to build your projects on a Linux container. Make sure your projects target .NET Core or .NET 5/6, which are cross-platform.
    2. Use the .NET Core cross-platform tools to build your projects on a Linux container. Make sure your projects target .NET Core or .NET 5/6, which are cross-platform.

    sample .gitlab-ci.yml file

    
    image: mcr.microsoft.com/dotnet/sdk:5.0
    
    stages:
      - build
      - package
    
    before_script:
      - apt-get update
      - apt-get install -y wine
      - wine --version
    
    build:
      stage: build
      script:
        - dotnet restore
        - dotnet build --configuration Release
    
    package:
      stage: package
      script:
        - wget https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip
        - unzip wix311-binaries.zip -d wix
        - export PATH=$PATH:$(pwd)/wix
        - wine candle.exe -arch x64 your_wix_project.wxs
        - wine light.exe -ext WixUIExtension -ext WixUtilExtension -out your_package_name.msi your_wix_project.wixobj
      artifacts:
        paths:
          - your_package_name.msi
    
    

    Please note that it is recommended to use a Windows-based GitLab runner when working with .NET Framework projects and MSI packages


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.