FergusMurray
Posts: 150
Joined: Thu Sep 30, 2010 10:44 am

Upgrade removed a file but never replaced it

We have an issue when we upgrade from one version of the software to another

We have a directory + files that is installed by the initial install that is removed by the upgrade, i cant see why tho. If i uninstall the old version and install the new version im getting those missing directories appear, it just seems to be on an upgrade that causes them not to appear

My "Upgrades" section is set to
"Automatically upgrade older products"
"use original installation path when upgrading" checked
and
"Uninstall old version first and then install new version"

I've checked the Component for one of the missing files, and there is no condition set on it, and it does not have "uninstall on supersedence" set on it

Is there something else that would prevent a folder and its associated files getting installed?
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Upgrade removed a file but never replaced it

Here's DLL file disappears during an upgrade related thread that explains this behavior. You could also try to enable Ensure that all files in this folder overwrite any installed target files option.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
FergusMurray
Posts: 150
Joined: Thu Sep 30, 2010 10:44 am

Re: Upgrade removed a file but never replaced it

The folders missing contain only XML files so i dont think that should have cause versioning issues, i've changed the folder to have the "Ensure that all files in this folder overwrite any installed target files" and will see how that affect it

I dont see why those folders/files should be removed tho, surely that setting determines whether you get the old version (i.e. existing) of the file, or the new delivered one, having it removed does smell like a bug
FergusMurray
Posts: 150
Joined: Thu Sep 30, 2010 10:44 am

Re: Upgrade removed a file but never replaced it

We had a new build to see if this approach worked, but unfortunately the files and folder are still missing

have sent the install log to support
Bogdan
Posts: 2794
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Upgrade removed a file but never replaced it

Looking over the aip file I noticed that the three XML files which were not installed were in the feature "DefaultScreens" which is set by default to not install. You can change this default from Organization page.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
FergusMurray
Posts: 150
Joined: Thu Sep 30, 2010 10:44 am

Re: Upgrade removed a file but never replaced it

Bogdan wrote:Looking over the aip file I noticed that the three XML files which were not installed were in the feature "DefaultScreens" which is set by default to not install. You can change this default from Organization page.

Regards,
Bogdan
That feature is controlled using a customaction (and then using vbs to set the feature on), so it should still work
Bogdan
Posts: 2794
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Upgrade removed a file but never replaced it

Hi,

The log still says the feature does not get installed. You can see that starting with line 52039. There you can see starting to execute the standard action FeaturePublish, for each feature at a time. In each call you can see the attribute "Absent". When its value is 2 it means the feature is installed, when its 3 it means is not installed. So the custom action must not be changing the feature states as expected, because as you can see DefaultScreens feature has the attribute set to value 3.

The custom action does seem to change the install state for BlueStyle feature, as its attribute is set to 2, even if the feature is set to not install by default.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
FergusMurray
Posts: 150
Joined: Thu Sep 30, 2010 10:44 am

Re: Upgrade removed a file but never replaced it

The custom action is calling this vbs function

Code: Select all

Function CheckForScreens()
	Dim fso, msg, objFSO, objFolder,colFiles,counted,temp, Installdir
	Installdir=Session.Property("APPDIR")&"Settings\Screens"
	Set fso = CreateObject("Scripting.FileSystemObject")
	counted=0
	WriteToLog("CheckForScreens: Looking for "&Installdir)
	If (fso.FolderExists(Installdir)) Then
		WriteToLog("CheckForScreens: Found existing screens folder, checking contents..")
		Set objFSO = CreateObject("Scripting.FileSystemObject")
		Set objFolder = objFSO.GetFolder(Installdir)
		Set colFiles = objFolder.Files
		For Each objFile in colFiles
			WriteToLog("CheckForScreens: found "&objFile.Name)
			' only count XML files, as these are the ones we're interested in
			If UCase(Right(objFile.Name,3))="XML" then
				counted=counted+1
			End if
		Next
		WriteToLog("CheckForScreens: found "&Cstr(counted)&" XML screens")
		if counted > 0 then
			WriteToLog("CheckForScreens: returned=0")
			Session.Property("APERTA_DEFAULTSCREENSEMPTY")="0"
		else
			WriteToLog("CheckForScreens: returned=1")
			Session.Property("APERTA_DEFAULTSCREENSEMPTY")="1"
		end if
	Else
		WriteToLog("CheckForScreens: returned=1")
		Session.Property("APERTA_DEFAULTSCREENSEMPTY")="1"
	End If
	If Session.Property("APERTA_DEFAULTSCREENSEMPTY")="1" Then
		' set the default screen feature to ON
		Session.FeatureRequestState("DefaultScreens") = msiInstallStateLocal
	else
		' set it off
		Session.FeatureRequestState("DefaultScreens") = msiInstallStateAbsent
	End if
End Function
Okay i think i understand why its missing, the custom action is attached to the dialogs, is the deinstall done after the UI? maybe the custom action needs moved after the uninstall part somehow?
Bogdan
Posts: 2794
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Upgrade removed a file but never replaced it

Hi,
is the deinstall done after the UI?
Yes, all system changes, i.e. uninstall of old version and install of resources from the new version, are executed during ProgressDlg, after the elevation prompt.

You can try to move the custom action after MigrateFeatureStates standard action, and set it as deferred with no impersonation.

Please note that deferred custom action actions can access only the special property CustomActionData. Here is an example that shows how to pass the value of your properties to the custom action using that special property.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
FergusMurray
Posts: 150
Joined: Thu Sep 30, 2010 10:44 am

Re: Upgrade removed a file but never replaced it

I've moved it to after "remove resources" and before "add resources", since it needs to decide after removing the "old release", however it looks like i dont have access to the feature states since this line:

Code: Select all

Const msiInstallStateAbsent = 2
Const msiInstallStateLocal  = 3
..
Session.FeatureRequestState("DefaultScreens") = msiInstallStateLocal
..
gives this error:

MSI (s) (6C:14) [11:01:52:980]: Product: Aperta Web Applications -- Error 1720. There is a problem with this Windows Installer package. A script required for this install to complete could not be run. Contact your support personnel or package vendor. Custom action CheckForScreensDeferred script error -2147467259, Msi API Error: FeatureRequestState,Feature Line 461, Column 3,


Any ideas?
Bogdan
Posts: 2794
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Upgrade removed a file but never replaced it

Hi Fergus,

I already mentioned this limitation in my previous post and present there instructions on what you can try.

However, before you do that can you please move the custom action after the standard action "MigrateFeatureStates" and set it as immediate. Normally, this stage handles the features in the new package based on the configuration of the old one, so you wouldn't need the deferred custom action after all, unless there is something else in your old package, custom code executed during the uninstall, that could affect the feature states.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
FergusMurray
Posts: 150
Joined: Thu Sep 30, 2010 10:44 am

Re: Upgrade removed a file but never replaced it

The custom code needs to looks at a folder after the items have been uninstalled from it to determine if there is anything in it (if there is, the feature should be disabled) and before the new stuff goes on, thats why i moved the action after the remove resources
FergusMurray
Posts: 150
Joined: Thu Sep 30, 2010 10:44 am

Re: Upgrade removed a file but never replaced it

I need the VBS to run after the files have been removed from the "old version", running the script while the old files are there, is going to give the wrong result (basically the code is deciding whether the installation needs to put some "default" settings files out, and these defaults shouldnt be there if there is already customised settings files there - i.e. ones created NOT by the installer)

If i move the custom action to just afer the MigrateFeatureStates, i dont have the option to defer the execution - im guessing i need that
Bogdan
Posts: 2794
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Upgrade removed a file but never replaced it

You need to have the custom action set after "RemoveExistingProducts", if you want it to be executed after the old version if removed. "MigrateFeatureStates", does just what its name suggest, sets the install level for the features from the new package as they were in the old version.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”