stacyirish
Posts: 4
Joined: Tue Dec 06, 2022 10:36 pm

How to use Advanced Installer Jenkins plug in from a jenkinsfile (script)

Hello! I have used the documentation How to configure an Advanced Installer build step into a Jenkins pipeline and Configure a Digital Certificate in a Jenkins Build Step: Jenkins Credentials and Azure Key Vault to successfully set up a Jenkins freestyle project to build my Advanced Installer project and sign everything using my digital certificate that is stored in Azure Key Vault. I would like to do this from a pipeline jenkinsfile script instead of a freestyle project.

I've not gotten far...

Code: Select all

withCredentials([string(credentialsId: 'AzureKeyVaultSecret', variable: 'AZURE_KEY_VAULT_SECRET')]) {
  // How to call the Advanced Installer plug in from here?
  // Using the Jenkins snippet generator to "Use a tool from a predefined tool installation" only generates the following line:
  // tool name: 'AdvancedInstaller_20.8', type: 'caphyon.jenkins.advinst.AdvinstInstallation'
}
Any help is appreciated.
Catalin
Posts: 6727
Joined: Wed Jun 13, 2018 7:49 am

Re: How to use Advanced Installer Jenkins plug in from a jenkinsfile (script)

Hello,

After some investigation, it looks like in order to call a plugin in your script, that specific plugin would need to be compatible with the pipeline.

Plugin Compatibility with Pipeline

I will try to add this on our TODO list of improvements and hopefully it will be added in a future version of our Jenkins Plugin.

Thank you for your understanding!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
stacyirish
Posts: 4
Joined: Tue Dec 06, 2022 10:36 pm

Re: How to use Advanced Installer Jenkins plug in from a jenkinsfile (script)

Thanks for the reply, Catalin.

Just to clarify, at the current time, the only way I can build my Advanced Installer package and digitally sign it with my certificate that is stored in Azure Key Vault from my jenkinsfile script would be to create a batch command and call Advanced Installer from the command line with a command file that contains the Azure Key Vault Secret?

Code: Select all

AdvancedInstaller.com /execute <path_to_project_file> <command_file_path> [-nofail]
This is not really preferred as I have to have a file containing the secret put somewhere too many people can get to. If you have some alternative solutions, I would appreciate them.

Meanwhile, I look forward to updates to the Advanced Installer Jenkins Plugin.
Catalin
Posts: 6727
Joined: Wed Jun 13, 2018 7:49 am

Re: How to use Advanced Installer Jenkins plug in from a jenkinsfile (script)

Hello,

That would indeed be the only solution currently available.

If there's anything else I could help you with, please let me know and I will gladly assist.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
agwin
Posts: 8
Joined: Mon Apr 22, 2024 6:44 pm

Re: How to use Advanced Installer Jenkins plug in from a jenkinsfile (script)

Hello @Catalin,

Has there been any progress on using the plugin from a Jenkinsfile?

Also, if I were to use the CLI, is it dependent on building in a Windows environment? All of our Jenkins build agents are currently running Linux, so I'd need to find another solution.

Thank you.
Catalin
Posts: 6727
Joined: Wed Jun 13, 2018 7:49 am

Re: How to use Advanced Installer Jenkins plug in from a jenkinsfile (script)

Hello,
Has there been any progress on using the plugin from a Jenkinsfile?
Unfortunately not. :(

However, I have increased the task's priority since more people seems to be needing this.
Also, if I were to use the CLI, is it dependent on building in a Windows environment?
Yes, the build must happen on a Windows machine considering Advanced Installer uses the Windows Installer technology.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”