- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: PowerShell detection via System Search
- 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
InstallShield 2014 Premier Edition
In the basic msi package we use InstallShield pre-defined check for PowerShell by searching the following registry:
HKLM\SOFTWARE\Microsoft\PowerShell\1\PowerShellEngine
Value: PowerShellVersion
This registry entry does not exist in some Server even though a new Powershell version is installed.
Is there any InstallShield recommendation for this?
Or should I use following advice:
https://devblogs.microsoft.com/powershell/windows-powershell-2-0-deprecation/
=============================================================================
Installation Checks for Windows PowerShell 2.0
You may also have a legacy application that checks for the existence of Windows PowerShell on the box via the registry, particularly for the existence of HKLM:\Software\Microsoft\Windows\PowerShell\1\PowerShellEngine. As long as your application only targets supported versions of Windows and Windows Server (7/8.1/10 and Server 2008R2/2012/2012R2/2016), you can remove this validation altogether.
If not, you should instead check for the existence of the file %systemroot%\system32\WindowsPowerShell\v1.0\powershell.exe. If your installer absolutely requires a registry-based validations, you should first check for HKLM:\Software\Microsoft\PowerShell\3\PowerShellEngine (note the 3) before falling back to HKLM:\Software\Microsoft\PowerShell\1\PowerShellEngine.
=======================================================================================
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi @angela_zakaim ,
Can you mention which server OS it doesn't have mentioned registry entry?There are two registry entries in general where powershell installation can be detected.
HKEY_LOCAL_MACHINE\Software\Microsoft\PowerShell\1\Install
and
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\3
The later one as system search is accepted as an enhancement and will be fixed in future releases from InstallShield.
I would also recommend you to consider things given under Windows PowerShell 2.0 deprecation as well for future benefits.
Thanks,
Jenifer
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi @angela_zakaim ,
How about using Windows Powershell application requirement from Project Assistant->Installation Requirements->Software Requirement(Select yes)->Windows PowerShell?
If you want to prevent the entire installation from running if PowerShell is not installed, you can use the Installation Requirements page of the Project Assistant (instead of the System Search view) to add the PowerShell system search to your project. If you do that, InstallShield uses the POWERSHELLVERSION property in a launch condition for the installation.
Thanks,
Jenifer
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hello Jenifer,
Thank you for your reply.
I have tried these ways. They all use \create the System Search for the registry entry:
Key: HKLM\SOFTWARE\Microsoft\PowerShell\1\PowerShellEngine
Value: PowerShellVersion
and as I wrote previously, this doesn't seem to be correct in some cases.
Hence, I wondered if IS is aware of that.
Thank you.
Angela
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi @angela_zakaim ,
Can you mention which server OS it doesn't have mentioned registry entry?There are two registry entries in general where powershell installation can be detected.
HKEY_LOCAL_MACHINE\Software\Microsoft\PowerShell\1\Install
and
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\3
The later one as system search is accepted as an enhancement and will be fixed in future releases from InstallShield.
I would also recommend you to consider things given under Windows PowerShell 2.0 deprecation as well for future benefits.
Thanks,
Jenifer
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hello Jenifer,
The OS is Windows Server 2019 and it seems the customer has uninstalled PowerShell 2.0 for security reasons.
We will modify our install as needed.
This issue can be closed.
Thank you.
![](/skins/images/3B39CE851FDD5528C393F146EB70A2D0/responsive_peak/images/icon_anonymous_message.png)