/build/static/layout/Breadcrumb_cap_w.png

Adding powershell custom Actions in MST

Hello ITNINJA's , 
Been a really long time, eh? anyways. We have a strange requirement. The client end has asked us to make use of powershell scripts as custom action (God knows why). But since it has, we have to do so. Now , i understand , we can add powershell custom actions in ISM and then compile it to generate an MSI. But how do we add them in a MST? I tried the old age method of copying rows from ISM and pasting them in MST , but that doesnt work. Similar is the problem for KillProcess custom action that ships with new version of installshield. Any help in this regard will be appreciable. 


3 Comments   [ + ] Show comments
  • PowerShell Scripts is available in 'InstallShield 2013' - vjay 10 years ago
  • you can call powershell script from Custom Action 'new exe > stored in binary table' - vjay 10 years ago
    • I am quite surprised at your answer to be upfront. I very clearly mentioned in the Question, i m planning to Use Custom Action in the form of Powershell in my MST and not ISM - talonsprem87 10 years ago
  • struggling with the same question since couple of weeks!!! Experts ideas would be much appreciated - ontari.ontari 10 years ago

Answers (1)

Posted by: karockiad 10 years ago
Orange Belt
0

Add an EXE custom action > path referencing a directory(type 3106).

Source: (Directory property of PS1 file where it is getting installed)

Target: <command line> ("[SystemFolder]WindowsPowerShell\v1.0\Powershell.exe" -file "[#filekeyofPS1]")

I belive this will be a workaround close to "New powershell > Installed with product" option in ISM..


Comments:
  • if the below is what u meant by the syntax is custom action table.
    StopService 3106 [INSTALLDIR] "[System64Folder]WindowsPowerShell\v1.0\Powershell.exe" -file "[stopservice.ps1]"

    I tried installing my MSI MST with the above customization. the powershell still fails to do the task(in my case stop a service (not system service)) - talonsprem87 10 years ago
    • source should be without [] braces and hence it will be INSTALLDIR.. if "stopservice.ps1" is the file name then you should choose the respective value in first column(file column) in file table, say for eg it is "stopserviceps1". then the command line will be
      "[System64Folder]WindowsPowerShell\v1.0\Powershell.exe" -file "[#stopserviceps1]"

      that # sign should be there in the braces.. - karockiad 10 years ago
      • Here is how the entry should look. In Custom Action table
        Action Type Source Target
        RunScript 3106 V10(the folder structure that I created in DirectoryTable representing the location of powershell exe) powershell.exe -file "[INSTALLDIR]StopService.ps1" - talonsprem87 10 years ago

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ