I have an old application I am trying to deploy to users through the Company Portal.
I created the PSADT installation and works fine locally, but when trying to install from the Company Portal it fails.
My script:
#endregion
##* Do not modify section above
##*===============================================
##* END VARIABLE DECLARATION
##*===============================================
If ($deploymentType -ine 'Uninstall' -and $deploymentType -ine 'Repair') {
##*===============================================
##* PRE-INSTALLATION
##*===============================================
[String]$installPhase = 'Pre-Installation'
## Show Welcome Message, close Internet Explorer if required, allow up to 3 deferrals, verify there is enough disk space to complete the install, and persist the prompt
Show-InstallationWelcome -CheckDiskSpace -PersistPrompt
## Show Progress Message (with the default message)
#Show-InstallationProgress
## <Perform Pre-Installation tasks here>
#[Environment]::SetEnvironmentVariable("IDAHOTECH_INSTALL_DIR", $dirFiles, "Machine")
#[Environment]::SetEnvironmentVariable("IDAHOTECH_INSTALL_DIR", $dirFiles, "User")
#$env:IDAHOTECH_INSTALL_DIR = $dirFiles
# Define the content of the Setup ISS file
$setupiss = @"
[InstallShield Silent]
Version=v6.00.000
File=Response File
[File Transfer]
OverwrittenReadOnly=NoToAll
[{8F07FAB0-5BBA-43EF-979E-6E7C9E4F811E}-DlgOrder]
Dlg0={8F07FAB0-5BBA-43EF-979E-6E7C9E4F811E}-SdWelcome-0
Count=7
Dlg1={8F07FAB0-5BBA-43EF-979E-6E7C9E4F811E}-SdLicense-0
Dlg2={8F07FAB0-5BBA-43EF-979E-6E7C9E4F811E}-SdComponentTree-0
Dlg3={8F07FAB0-5BBA-43EF-979E-6E7C9E4F811E}-SdAskDestPath-0
Dlg4={8F07FAB0-5BBA-43EF-979E-6E7C9E4F811E}-AskOptions-0
Dlg5={8F07FAB0-5BBA-43EF-979E-6E7C9E4F811E}-AskYesNo-0
Dlg6={8F07FAB0-5BBA-43EF-979E-6E7C9E4F811E}-SdFinishReboot-0
[{8F07FAB0-5BBA-43EF-979E-6E7C9E4F811E}-SdWelcome-0]
Result=1
[{8F07FAB0-5BBA-43EF-979E-6E7C9E4F811E}-SdLicense-0]
Result=1
[{8F07FAB0-5BBA-43EF-979E-6E7C9E4F811E}-SdComponentTree-0]
szDir=C:\Program Files (x86)\Roche\LightCycler480
Component-type=string
Component-count=2
Component-0=Main App
Component-1=Adobe-Acrobat
Result=1
[{8F07FAB0-5BBA-43EF-979E-6E7C9E4F811E}-SdAskDestPath-0]
szDir=C:\Program Files (x86)\Roche\LightCycler480
Result=1
[{8F07FAB0-5BBA-43EF-979E-6E7C9E4F811E}-AskOptions-0]
Result=1
Sel-0=1
Sel-1=1
[Application]
Name=LightCycler 480
Version=1.5.1
Company=Roche
Lang=0009
[{8F07FAB0-5BBA-43EF-979E-6E7C9E4F811E}-AskYesNo-0]
Result=0
[{8F07FAB0-5BBA-43EF-979E-6E7C9E4F811E}-SdFinishReboot-0]
Result=1
BootOption=0
"@
# Save the content to a file with .iss extension
$setupiss | Out-File -FilePath "$dirFiles\setup.iss" -Encoding ASCII -Force
##*===============================================
##* INSTALLATION
##*===============================================
[String]$installPhase = 'Installation'
## <Perform Installation tasks here>
$env:IDAHOTECH_INSTALL_DIR = $dirFiles
Execute-Process -Path "Setup.exe" -Parameters "-s"
##*===============================================
##* POST-INSTALLATION
##*===============================================
[String]$installPhase = 'Post-Installation'
## <Perform Post-Installation tasks here>
Copy-File -Path "$dirFiles\Roche\*" -Destination "$envProgramData\Roche" -Recurse
## Display a message at the end of the install
It is this $env:IDAHOTECH_INSTALL_DIR = $dirFiles variable that the .exe needs. If that is not present, the EXE fails and tells you the “IDAHOTECH_INSTALL_DIR” is missing.
I think when installing it through company portal, it does not work this way with setting the env. I also tried with the system variables:
#[Environment]::SetEnvironmentVariable(“IDAHOTECH_INSTALL_DIR”, $dirFiles, “Machine”)
#[Environment]::SetEnvironmentVariable(“IDAHOTECH_INSTALL_DIR”, $dirFiles, “User”)
But that didn’t work either (commented out after trying the other method).
In what context are you doing the installation (User or System)?
I suspect if you are deploying in the User context some of that may not work due to the rights the user has on their device (That may be why you were unable to set the machine environment variable)
I’m not sure if in the user context the Setup ISS file could be generated into that path (user might not have write permissions to C:\Windows\IMECache\<Intune_Application_GUID>\ - Why don’t you create this static file and bundle it up with the Intunewin file in the Files sub-directory?
That way the file will always exist within the deployment correctly . You can then remove the definition of $setupiss and writing this to a file within your Deploy-Application.ps1
I write that file cause for the uninstall I need another iss file and the name is the same. The writing to that directory works, I see it get created. Did not check if it had any content though, let me confirm that.
Or the setup.exe does not have permission to read it? Though the app itself needs admin rights…which makes me believe it can read it.
So, If you are deploying as Admin (I’ll have to assume you mean SYSTEM?)
What is the Install command line you have configured in Intune for this deployment?
I’m wondering if maybe the application is showing a message that is not being shown to you as this will appear in the SYSTEM context (not the logged on users context).
By using ServiceUI.exe you could see if this resolves the issue
(this may help: Installation messages using ServiceUI.exe in Intune - #3 by Adrian_Scott)
Yeah I figured.
This install file is more then 10 years old. Had to figure out all the silent stuff and respose files.
Finally found out how to specify the answer file, so now I create a setup.iss (default name for the /s parameter) and an uninstall.iss.
I had to use the /f1 parameter (/f1"path to iss").
Been at this for days.
Are you trying to set these variables during AutoPilot /ESP or as a “on Demand” app?
I use a PS script to create Environment Variables with PowerShell during AutoPilot /ESP BEFORE any Win32app packages with PSADT are run.
In my situation, NONE of the environment variables I create get fully set because the Intune Management Engine (IME) does not deal with user32.dll’s SendMessageTimeout function’s call. This is a function that tells running processes to check for new Environment Variables. In this situation, IME ignores the call. It a bug in IME.
In your situation, you might have to create the Environment Variables, reboot, then install your app.
I finally found the culprit.
It was the Setup.exe writing the log to the same directory, which is not possible in User context. Again had to find out how to write the log to Temp, I did, and that did the trick. It finally installs.
Thanks for all the tips guys!