This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Powershell Custom action problems. Please help
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 15, 2018
06:49 PM
Powershell Custom action problems. Please help
I'm trying to run the following command during an install to enable IIS if it is not enabled
Dism /Online /Enable-Feature /FeatureName:IIS-DefaultDocument /All
I can run this from Powershell with no problems but if I try a powershell custom action or even a launchappwait launching Powershell.exe I cannot make this work.
How can I get this command to work in an Installshield BasicMSI project? Are there some installscript commands I can use?
Thank you
Brandon
Dism /Online /Enable-Feature /FeatureName:IIS-DefaultDocument /All
I can run this from Powershell with no problems but if I try a powershell custom action or even a launchappwait launching Powershell.exe I cannot make this work.
How can I get this command to work in an Installshield BasicMSI project? Are there some installscript commands I can use?
Thank you
Brandon
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 16, 2018
09:01 AM
Is this happening on Windows 10?
Is your InstallShield package a 32 bit package?
I ran into the same thing executing PS in a bat file. I found that you need to execute the 64 bit version of PS.
YES, there is a 32 bit and a 64 bit version! And if your IS package is 32 bit, it will execute the 32 bit version of PS!
Here's what I did in a bat file. Do the translation for your application.
REM To avoid error on Windows 10 we need to specify path to 64 bit PS as done below because our parent process is 32 bit.
SET "PSx64=" & REM Can't use sysnative on Server 2012 R2
IF "%WinVer%"=="10" SET "PSx64=%windir%\sysnative\WindowsPowerShell\v1.0\"
"%PSx64%POWERSHELL.EXE" ... rest of your PS command line
Is your InstallShield package a 32 bit package?
I ran into the same thing executing PS in a bat file. I found that you need to execute the 64 bit version of PS.
YES, there is a 32 bit and a 64 bit version! And if your IS package is 32 bit, it will execute the 32 bit version of PS!
Here's what I did in a bat file. Do the translation for your application.
REM To avoid error on Windows 10 we need to specify path to 64 bit PS as done below because our parent process is 32 bit.
SET "PSx64=" & REM Can't use sysnative on Server 2012 R2
IF "%WinVer%"=="10" SET "PSx64=%windir%\sysnative\WindowsPowerShell\v1.0\"
"%PSx64%POWERSHELL.EXE" ... rest of your PS command line
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 16, 2018
09:14 AM
rguggisberg wrote:
Is this happening on Windows 10?
Is your InstallShield package a 32 bit package?
I ran into the same thing executing PS in a bat file. I found that you need to execute the 64 bit version of PS.
YES, there is a 32 bit and a 64 bit version! And if your IS package is 32 bit, it will execute the 32 bit version of PS!
Here's what I did in a bat file. Do the translation for your application.
REM To avoid error on Windows 10 we need to specify path to 64 bit PS as done below because our parent process is 32 bit.
SET "PSx64=" & REM Can't use sysnative on Server 2012 R2
IF "%WinVer%"=="10" SET "PSx64=%windir%\sysnative\WindowsPowerShell\v1.0\"
"%PSx64%POWERSHELL.EXE" ... rest of your PS command line
I will test this in just a little while and let you know how it goes. Running powershell and doing Dism commands from an install project is all new to me so I'm a little lost and have a project with a lot of IIS and Azure config to do.
![](/skins/images/A5EADE085F77DE82FB3B14D6B307AE6A/responsive_peak/images/icon_anonymous_message.png)