Custom action not run under Vista/7 - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

ata
Posts: 6
Joined: Sun Sep 13, 2009 10:20 pm

Custom action not run under Vista/7

Hi,

I have a custom action run under InstallUISequence/ProgressDlg. It's a .bat file which is run using the viewer.exe. The file is executed fine under XP (a command prompt is opened and the bat is executed after which the window is closed again), but under Vista I just get a Windows Explorer opened (huh!?) and under Windows 7 nothing happens.

I'm using advanced installer 7.5.

The Custom action properties are:
Source Path: <AI_CUSTACTS>viewer.exe
Source Type: Executable (*.exe)
Command line: "[&uninstall.bat]"


Any ideas what is causing this?
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Custom action not run under Vista/7

Hello,

We are reviewing the behavior and will get back to you when we reach a conclusion.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Custom action not run under Vista/7

Hello,

It appears the .bat file, even though it is marked as a temporary file, is not created on the disk due to lack of permissions. Since the custom action creating the temporary file is executed on the UI Sequence, it is not yet elevated. To work around this problem, place your bat file in the "Windows Volume->Temporary" folder.

Let me know how this worked for you.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
ata
Posts: 6
Joined: Sun Sep 13, 2009 10:20 pm

Re: Custom action not run under Vista/7

Hi,

Just tried it on Windows 7 and it didn't work, unfortunately. The file is copied to the temporary directory of the user, alright, but it does not seem to be executed.

What should the command line be?
[TempFolder]\[#uninstall.bat]
or just
[#uninstall.bat]

The bat file only contains a lot of lines like this one for uninstalling any older version that the user may have.
MsiExec.exe /X{33ADE68A-0131-4397-B944-DF0703C2749B} /quiet

We went from a version 1.0 to 2.0 and installation type changed from per-user to per-machine (user must be admin), so the automatic uninstall of older versions dosn't work, I think. If there's a better way to achieve this I'm all ears.
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Custom action not run under Vista/7

Hello,

The command line should be "[#uninstall.bat]" including the quotes. You can place a "pause" command at the beginning of your bat to make sure that it is executed.

However your goal can better be achieved by using the Upgrades page in Advanced Installer. Simply add a New upgrade. Select the version 1.0 of your product's installer and the Upgrade Code will automatically be added to the Upgrades list. Your product should now uninstall all previous versions of your product.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
ata
Posts: 6
Joined: Sun Sep 13, 2009 10:20 pm

Re: Custom action not run under Vista/7

Thanks for your quick reply, but sadly I'm still without luck. The bat file is still not exected.

The other method I tried earlier as well, but couldn't make it work either.

We have a number of old versions ranging from 1.0.0 to 1.1.5.

When adding a new upgrade the code returned is {6221FB65-A0A3-4E0E-9E76-23CA409D1A77} for all versions.
In order for the bat script to work the code must be different than the above for all older versions. E.g. this one uninstalls version 1.1.5 only:
MsiExec.exe /X{71D42EA9-507C-4509-B395-B55B5B91A65F} /quiet

Running msiexec with the {6221FB....} code uninstalls nothing...
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Custom action not run under Vista/7

Hello,

What msiexec is taking as a parameter for /X is the ProductCode. This is different from the UpgradeCode retrieved from the Upgrades page in Advanced Installer.
You can send us the .aip project file to support at advancedinstaller dot com and perhaps some previous versions of the product so we can take a look at what the problem is.
Also note that if you added the UpgradeCode from the Upgrades page to your project, there would be no further need for the bat file. Your new version should automatically uninstall all previous versions.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
ata
Posts: 6
Joined: Sun Sep 13, 2009 10:20 pm

Re: Custom action not run under Vista/7

Thanks,

I'll send a mail to support.

Return to “Common Problems”