cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
DonAIR
Level 6

Suite Installers passing properties to Actions?

I am wondering how to get custom/inbuilt properties from a Suite Installer via a PowerShell Action? I am trying to modify the Installation Directory of InstallScript projects and since you can't pass variables to setup.exe's I thought I would edit the response files prior to installation of the packages. The PowerShell I am using is:

 

$installpath = get-property -name INSTALLPATH
$isspath = get-property -name SETUPSUPPORTDIR

((Get-Content -path "$isspath\Model_01_Install.iss" -Raw) -replace 'INSTALLATION_PATH',$installpath) | Set-Content -Path "$isspath\Model_01_Install.iss"

INSTALLPATH is a custom property and SETUPSUPPORTDIR is a built in one. Via the UI I see the PowerShell runs but it does nothing, so either its not running or the variables are bad and the PowerShell is failing. If I run it outside of InstallShield with hard-coded values it works fine.

 

I have it set to deploy during OnPackagesConfiguring, with no condition and have tried both Admin/No admin privileges.

I guess I am looking for help with either getting a powershell to run or how to pass properties to powershell. 

Labels (1)
0 Kudos
(9) Replies
MarkusLatz
Level 8

I'm unfamiliar with powershell, because I work with InstallScript and C/C++, but I've seen in the help library that to get/set properties in suite you have to use "get-suiteproperty" and "set-suiteproperty"

https://helpnet.flexerasoftware.com/installshield24helplib/installshield24helplib.htm#helplibrary/SteActionPSCreate.htm?Highlight=powershell

regards

Markus

 

0 Kudos
MarkusLatz
Level 8

And can you explain this:

Spoiler
"and since you can't pass variables to setup.exe's "

Because in the suite I can pass properties (variables) to each package.

And if the package is an InstallScript package I can get everything with CMDLINE inside the setup.exe from the InstallScript package.

https://helpnet.flexerasoftware.com/installshield24helplib/Subsystems/LangRef/helplibrary/LangrefCMDLINE.htm

 

Or may be I understand your question not correct ?

regards

Markus

0 Kudos

@MarkusLatz , I would definitely prefer doing it correctly via your second method, thank you the first method worked.

My understanding from InstallShield themselves is I can not do it though:

https://community.flexera.com/t5/InstallShield-Forum/Passing-Properties-in-Suite-installers-to-packages/m-p/114720#M66721

Would I not even need to use .iss files either? What does your command line look like? All I need to do is install InstallScript packages silently but need to pass a install directory to them.

0 Kudos

I'm not sure, if I look at the other post I see, you call the InstallScript package with "data1.hdr" and not through the "setup.exe".

I normally always call "setup.exe". But let me do some testing with my packages ...

In general you need the ".iss" file to "answer" all questions/settings that the setup package need to install.

regards

Maruks

0 Kudos

we are using setup.exe now. we currently do this:

Setup.exe /s /f1"[SETUPSUPPORTDIR]\Model_01_Install.iss"

and we are running Powershell (thanks to your help) to update the Model_01_Install.iss file prior to execution. But if we can just take the property from the Suite and pass it directly to the command line that would be much better.

 

0 Kudos

Hello @DonAIR ,

just tried and it works with using .hdr or .exe in the suite project.

But the important thing is, that you have to pass command line arguments that can accessed through CMDLINE before any other switches :

setup.exe arg1 arg2 arg3 /s /f1"[SETUPSUPPORTDIR]\Model_01_Install.iss"

I have build an InstallScript Sample Project and Adv. Suite Project as sample (Installshield 2016), take a look there. I have referenced two "sample files" to install from the InstallShield 2016 Samples. If you use IS2019 you have to adjust the references.

The InstallScript Project creates a info file in C:\Temp where the value from CMDLINE is written. Just quick and dirty. Just try and let me know if you have further questions.

regards

Markus

 

0 Kudos

@MarkusLatz ,

thanks again, so shouldn't it just be as simple as this in my OnFirstUIBefore?

TARGETDIR = CMDLINE;

and in the suite set command line and silent command line to my Property, which is [INSTALLPATH] (fyi i was testing with InstallScript in this case not setup.exe)? its not taking the effect for some reason. I will keep playing with it.

0 Kudos

This is a mistake I did also when I build the example.

"OnFirstUIBefore" is called only if there is an UI (User Interface). But because you call the InstallScript project from the suite it is always silent.

In the sample I used the "OnSetTARGETDIR" event, but check the manual you can use also an other event, but take care that it is called in "suite" mode.

regards

Markus

ya im an idiot haha, caught it right after posting it. Now I just need a way to strip out the characters from CMDLINE and im golden as cmdline returns:

[PROPERTY] ISFeatureInstall=ALL so for example in my case:

C:\Program Files\AIR\Models ISFeatureInstall=ALL when I just want C:\Program Files\AIR\Models

0 Kudos