Dashut
Posts: 142
Joined: Tue May 04, 2010 4:41 pm

Temporary file missing when upgrading

Using AI 7.7:
I have a custom action (ImportLatestRevisionSchemaChanges) under "install" with "execution condition": "(Not Installed)".
In this custom action I am using a temporary file (observer_ems.sql):

Code: Select all

"[MYSQL_PATH]" -uroot -ppassword -f -e "source [&observer_ems.sql]"
When I first time install my program: this custom is run and works as expected.
When I perform upgrade: it fails:

Code: Select all

MSI (s) (E8:88) [02:22:42:053]: Executing op: ActionStart(Name=ImportLatestRevisionSchemaChanges,,)
Action 2:22:42: ImportLatestRevisionSchemaChanges. 
MSI (s) (E8:88) [02:22:42:053]: Executing op: CustomActionSchedule(Action=ImportLatestRevisionSchemaChanges,ActionType=3074,Source=BinaryData,Target="C:\Program Files\MySQL\MySQL Server 5.1\bin\mysql.exe" -uroot -ppassword -f -e "source C:\Users\Observer\AppData\Local\Temp\observer_ems.sql",)
CustomAction ImportLatestRevisionSchemaChanges returned actual error code 1 (note this may not be 100% accurate if translation happened inside sandbox)
MSI (s) (E8:88) [02:22:42:553]: Note: 1: 1722 2: ImportLatestRevisionSchemaChanges 3: C:\Windows\Installer\MSI2329.tmp 4: "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysql.exe" -uroot -ppassword -f -e "source C:\Users\Observer\AppData\Local\Temp\observer_ems.sql" 
and installation stops.
I checked at this point that the installer is "stuck" for me to acknowledge the error, and manually search for "C:\Users\Observer\AppData\Local\Temp\observer_ems.sql", and I see that it really doesn't exist!

What's going on here? how to solve this?
My project is set to "Uninstall first, and then install" (remember: first time installation this works, it only fails at upgrade).
Dashut.
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Temporary file missing when upgrading

Hi Dashut,

Can you please send us the aip file and verbose log to support at advancedinstaller dot com so we can investigate them?

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Temporary file missing when upgrading

Hi Dashut,

I did a little more investigations and it seems that indeed the temporary file was removed by the uninstall process of the old version and wasn't available after the standard action "InstallValidate" from InstallExecuteSequence.

So you have two solutions:
-- The first solution is to move the custom action under InstallValidate or earlier. If this of course is allowed by your setup (i.e. you don't have other restrictions that force you to execute the custom action at that stage).

-- The second solution is very simple, you need to add this condition for the file in both versions of your package:

Code: Select all

NOT UPGRADINGPRODUCTCODE
If you already deployed the first version of the package to your users then you will have to use the method you already implemented (with the file installed and deleted). But I also recommend you add the temporary file with this condition so for future versions you can use it without any problems and remove the file from the installed ones.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Dashut
Posts: 142
Joined: Tue May 04, 2010 4:41 pm

Re: Temporary file missing when upgrading

So for the temporary file to be always available: I have to:
1. Add it as temporary file
2. Right-click on the file (from "Files and Folders"-> "Windows Volume"->"Temporary"-> <my file>)
3. In the "Edit Temporary File", under "Properties" in "Condition" set it to "NOT UPGRADINGPRODUCTCODE"?

Is that what I need to do to make it work?
Dashut.
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Temporary file missing when upgrading

Hi Dashut,
Is that what I need to do to make it work?
Yes, this is what you need to do in both versions of your package, not just in the latest version.

As I already said, if you already deployed the first version of the package to your users then you will have to use the method you already implemented (with the file installed and deleted).
But I also recommend you add the temporary file with this condition so for future versions you can use it without any problems and remove the file from the installed ones.

I've tested this on my machine and worked without any problems.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
bccc
Posts: 9
Joined: Wed Aug 25, 2010 10:41 pm

Re: Temporary file missing when upgrading

I have encountered a similar issue during the upgrade process and tried the solution of using the condition "NOT UPGRADINGPRODUCTCODE" for the temporary file. However, this temporary file is also used during the uninstall process. So, when performing the upgrade the uninstall now fails. In looking at the log, it appears as though the problem is the target for the custom action (i.e. my executable) is equal to "". Thoughts? How is it that I can use the temporary file from the original MSI for the uninstall and the temporary file from the new MSI for the install? I am configured to uninstall the old version and then install the new version.
Dashut
Posts: 142
Joined: Tue May 04, 2010 4:41 pm

Re: Temporary file missing when upgrading

They way I understand it: you'll have to uninstall (manually) your current version, and from then on: every new upgrade should work for you.
This is because then upgrading: you *old* msi is run, and only then the *new* msi: so the problem is that you don't have this temp file in your *old* msi "yet".
Dashut.

Return to “Common Problems”