Community Forums
Results 1 to 5 of 5

Thread: How to run Installshield 2016 with powershell parameters?

  1. #1
    Join Date
    Apr 2018
    Posts
    2

    Post How to run Installshield 2016 with powershell parameters?

    I'm trying to use Installshield and run a Powershell command with parameters. I didn't find anything online or in the manual. Anyone have any ideas?

  2. #2
    Join Date
    Aug 2005
    Posts
    545
    Quote Originally Posted by jweiss View Post
    I'm trying to use Installshield and run a Powershell command with parameters. I didn't find anything online or in the manual. Anyone have any ideas?
    Do you mean, as a custom action?

    http://helpnet.installshield.com/ins...PowerShell.htm

    Or as a *.prq?

    (Just run it with params like you would from the command line)

    Or are you trying to use the InstallShield Automation layer?

    https://blogs.flexera.com/installtal...nd-powershell/
    Cary R.
    Configuration Engineer

  3. #3
    Join Date
    Apr 2018
    Posts
    2
    I'm trying to run it as a custom action. I right click on Custom Actions and select - New Powershell- stored in binary table.
    I can do this and point to the powershell script but adding any command line options after the filename causes a error 'The file name specified does not exist.'

    Is there another way to do it?

  4. #4
    Join Date
    Jul 2003
    Location
    North Kingstown, RI, USA
    Posts
    1,344
    Quote Originally Posted by jweiss View Post
    I'm trying to use Installshield and run a Powershell command with parameters. I didn't find anything online or in the manual. Anyone have any ideas?
    One way to handle this is to first set property values in your installer and in your PowerShell script call get-property -name [Property Name]
    http://helpnet.flexerasoftware.com/i...PowerShell.htm

    DISCLAIMER: I have never run a PowerShell custom action - but have plenty of experience with other types.
    Regards,
    Dan Lee

    Release Engineer

  5. #5
    Join Date
    Nov 2004
    Posts
    47
    As you’ve discovered, one can’t pass parameters when calling a PowerShell Script File Name.

    Do what Dan L. suggested and pass your needed parameters vis [PROPERTIES]

    Here is a simple PowerShell .ps1 file you can try that gets a property.
    It includes a MessageBox that comes up in the middle of install that can be used to debug.
    Also includes a line that writes to the Installer log.
    If you place this Custom Action in the User Interface sequence you can see the dialog when running in Test User Interface mode.
    You can also run the script in the PowerShell ISE app. You’ll get an error when it tries the get-property and trace-info as those are InstallShield-only components but it will run and you’ll get the dialog.


    ##
    $Value1 = get-property -name INSTALLLEVEL

    [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
    $Message = "INSTALLLEVEL: $Value1 "
    $Title = "Property Check"
    $Buttons = "OK"
    $Icon = "Information"
    $oReturn=[System.Windows.Forms.MessageBox]::Show($Message, $Title, $Buttons, $Icon)

    trace-info -LogMessage "INSTALLLEVEL was $value1"
    ##

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •