ReynoldsL05
Posts: 19
Joined: Fri Oct 11, 2024 11:41 am

All custom actions failing during upgrade

I am trying to implement upgrades for my installer by changing the product code and allowing downgrades to lower versions / the same version.
It seems to work for the most part, however whenever I use the upgrade, the previous version is uninstalled successfully, however any existing installation custom actions will fail when installing the ugraded version. (they do not fail when doing initial install; In the upgrade, they give a "Could not find source script file error")

Code: Select all

MSI (s) (B0:F0) [11:52:35:633]: Executing op: CustomActionSchedule(Action=PowerShellScriptFile,ActionType=3073,Source=BinaryData,Target=RunPowerShellFileScript,CustomActionData=Flags0ParamsPropertyC:\Users\SPT~1.BUI\AppData\Local\Temp\AddHostsEntry.ps1ScriptPreambleparam(
  [alias("propFile")]      [Parameter(Mandatory=$true)] [string] $msiPropOutFilePath
 ,[alias("propSep")]       [Parameter(Mandatory=$true)] [string] $msiPropKVSeparator
 ,[alias("lineSep")]       [Parameter(Mandatory=$true)] [string] $msiPropLineSeparator
 ,[alias("scriptFile")]    [Parameter(Mandatory=$true)] [string] $userScriptFilePath
 ,[alias("scriptArgsFile")][Parameter(Mandatory=$false)][string] $userScriptArgsFilePath
 ,[Parameter(Mandatory=$true)]                          [string] $testPrefix
 ,[switch]                                                       $isTest
 )

Function AI_GetMsiProperty( [Parameter(Mandatory=$true)]  [string] $name
                          , [Parameter(Mandatory=$false)] $testValue = $null
                          )
{
  if ($isTest -and ($testValue -ne $null
MSI (s) (B0:F8) [11:52:35:666]: Invoking remote custom action. DLL: C:\Windows\Installer\MSI7358.tmp, Entrypoint: RunPowerShellFileScript
[INFO] PowerShell script preferred invocation folder: 
Dumping PowerShell invoke log ...
--> Found PowerShell path: C:\Users\SPT~1.BUI\AppData\Local\Temp\AddHostsEntry.ps1
--> PowerShell Script Execution Result Code: -1
--> PowerShell Script Execution log: 
[ERR] Could not find source script file!
CustomAction PowerShellScriptFile returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
(The output file has some STX and SOH characters in the first line that aren't visible here)

Does anyone know why this might be?
ReynoldsL05
Posts: 19
Joined: Fri Oct 11, 2024 11:41 am

Re: All custom actions failing during upgrade

It appears that doing the update messes up the uninstall later as well
Catalin
Posts: 7492
Joined: Wed Jun 13, 2018 7:49 am

Re: All custom actions failing during upgrade

Hello,

An upgrade works by uninstalling the previous version and then installing the newer one.

That being said, please make sure that your custom actions are not scheduled to be executed during the uninstall of the previous version, as the actions might try to execute after the resources have been removed already - this can cause an error.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ReynoldsL05
Posts: 19
Joined: Fri Oct 11, 2024 11:41 am

Re: All custom actions failing during upgrade

How can I ensure that the installation will not try to do something before the uninstallation has finished?
ReynoldsL05
Posts: 19
Joined: Fri Oct 11, 2024 11:41 am

Re: All custom actions failing during upgrade

Found this previous question which seems to have fixed my issue, ty
viewtopic.php?f=2&t=23712#p60573
Liviu
Posts: 1325
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: All custom actions failing during upgrade

Hello,

Thank you for your followup.

Yes, this the the correct approach (to create a subfolder with a unique name for each version) in these cases.

Let us know if you have any other questions.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”