leeroy
Posts: 28
Joined: Mon May 03, 2021 11:13 pm

Empty Command Line Parameters Merged Together

Mon Apr 03, 2023 10:37 pm

Hi, we are running an Inline Powershell Script and passing in parameters, but when a user passes in empty parameters on the command line the values are munged together in an unusual way.

Command:

Code: Select all

msiexec.exe /i installer.msi /qn HP_URL="" IDS="123456"
Powershell Inline Script:

Code: Select all

Parameter values: 
-cfPath "[APPDIR]/Config.json" -tkURL [TK_URL] -hpURL [HP_URL] -ids [IDS]
Params (cfPath and tkURL are calculated from other scripts): :

Code: Select all

Param($cfPath , $tkURL , $hpURL , $ids )
$hpURL = "IDS=123456" <-- This has been munged together
$ids = ""
However if HP_URL is provided a value other then empty string it works fine.

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Empty Command Line Parameters Merged Together

Tue Apr 04, 2023 2:48 pm

Hello,

If possible, could you please create a sample project that reproduces this and forward it to me?

I'm afraid I wasn't quite able to reproduce this on my end.

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

leeroy
Posts: 28
Joined: Mon May 03, 2021 11:13 pm

Re: Empty Command Line Parameters Merged Together

Tue Apr 04, 2023 10:46 pm

Hi Catalin,

I made a simple install. After you build it just run it like the following.

Code: Select all

msiexec.exe /i paramTester.msi /qn BAR="" BAZ="2041860278"
Output:
Image

The baz param ends up in the bar param.
Attachments
Your Application.aip
Sample Application
(15.83KiB)Downloaded 111 times

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Empty Command Line Parameters Merged Together

Fri Apr 07, 2023 3:32 pm

Hello,

I have tested this using the AIP file you provided, but I'm afraid I'm not able to reproduce this:
Screenshot_107.png
Screenshot_107.png (31.01KiB)Viewed 6307 times

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

leeroy
Posts: 28
Joined: Mon May 03, 2021 11:13 pm

Re: Empty Command Line Parameters Merged Together

Wed Apr 12, 2023 12:49 am

Hi Catalin,

I wonder if you ran this in a regular command prompt, not PowerShell. I believe this only occurs in PowerShell.

Kind regards,
Lee

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Empty Command Line Parameters Merged Together

Tue Apr 18, 2023 5:12 pm

Hello Lee,

There shouldn't be any differences if you run the setup from a PowerShell or a CMD shell.

I have tested this with PowerShell and the results are the same:
Screenshot_110.png
Screenshot_110.png (56.03KiB)Viewed 5116 times

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

Return to “Building Installers”