Question on Loops. Newbie on Powershell

Topics: Archive - General
Jan 9, 2014 at 9:22 PM
Edited Jan 10, 2014 at 4:27 PM
Hi,

I'm was trying to detect .NET Extended via registry GUID if it is installed on machines using the script below and once detected, I would like to ignore or bypass the dotNetFx40_Full_x86_x64.exe installation and continue the install of BrainStorm but if not detected, I would like dotNetFx40_Full_x86_x64.exe to be installed together with BrainStorm. See script below. It kinda works but always installs dotNetFx40_Full_x86_x64.exe regardless of the detection. Thanks for all your help.

*===============================================

* PRE-INSTALLATION

If ($deploymentType -ne "uninstall") { $installPhase = "Pre-Installation"

*===============================================

# Show Welcome Message, close applications if required, allow up to 3 deferrals
Show-InstallationWelcome -CloseApps "iexplore,excel,groove,onenote,infopath,onenote,outlook,mspub,powerpnt,winword,winproj,visio" -AllowDefer -DeferTimes 3
# Scans for .NET Extended Installation
Get-RegistryKey "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{8E34682C-8118-31F1-BC4C-98CD9675E1C2}"  -ContinueOnError   
# Show Progress Message
Show-InstallationProgress "BrainStorm Quick Help x86 3.02 Installation in Progress..." -WindowLocation "BottomRight" -TopMost $false
# Remove any previous versions of BrainStorm
Remove-MSIApplications "BrainStorm"

*===============================================

* INSTALLATION

$installPhase = "Installation"

*===============================================

# Install the base EXE
Execute-Process -FilePath "dotNetFx40_Full_x86_x64.exe" -Arguments "/q /norestart"

# Install the base MSI and apply a transform
Execute-MSI -Action Install -Path "BrainStormQuickHelpX86.msi" -Transform "Brainstorm_Training_3.0.mst" -Parameters "DESKTOPICON=0 LOGINMETHOD=SSO COMPANYNAME=gm.com /QN"

*===============================================

* POST-INSTALLATION

$installPhase = "Post-Installation"

*===============================================

*===============================================

* Installation Restart Prompt

$installPhase = "Reboot Required"

*===============================================

#Installation Restart Prompt
Show-InstallationRestartPrompt -Countdownseconds 600 -CountdownNoHideSeconds 60
Coordinator
Jan 12, 2014 at 2:03 PM
Edited Jan 12, 2014 at 2:07 PM
Looks like Dan has answered this question in the post here: https://psappdeploytoolkit.codeplex.com/discussions/484300
Marked as answer by ccastillo1005 on 1/13/2014 at 9:22 AM