BPeters
Posts: 17
Joined: Tue Aug 30, 2005 4:58 pm

Repairing and Feature Conditions

My installation contains 3 files that are needed only for installation. They are accessed from a custom DLL and then deleted by the DLL. However when the application is repaired the 3 files are restored.

1. Is there a way that I can set the component properties under organization so that the files are only added during installation and not on a repair? And if not where should a custom action be added so that the files can be removed after they are repaired.

2. I also have a registry key that when installed is NULL but the value is set by the custom action. But again on a repair the value is reset to NULL. Is there anyway to set the condition or is a custom action required and if so where should I put it.

- Brad
BPeters
Posts: 17
Joined: Tue Aug 30, 2005 4:58 pm

I am also curious how you would go about disableing the Modify option when an msi file is run after it is installed. Ideally I would like to stop the user from repairing or modifying once installed successfully.

Thanks
-Brad
Mike
Posts: 292
Joined: Wed Jun 01, 2005 10:50 am
Location: Craiova, Romania
Contact: Website

Hi,

In order for the custom actions to be executed you need to clear their execution condition. You are probably using the "NOT Installed" condition which means that CA runs only on install.

For more information on this please visit:

http://msdn.microsoft.com/library/defau ... syntax.asp


If you want to disable the certain functionalities (e.g. Repair) there are some properties that you can set. Setting a property means giving it a value other than the null string. You can use for this a "Property Set With Formatted" type of CA.

For more information please visit:

http://msdn.microsoft.com/library/defau ... modify.asp
http://msdn.microsoft.com/library/defau ... REPAIR.asp

http://msdn.microsoft.com/library/defau ... erties.asp

Hope this helps.

Regards,
Mihai
Mihai Bobaru
Advanced Installer Team
http://www.advancedinstaller.com
BPeters
Posts: 17
Joined: Tue Aug 30, 2005 4:58 pm

I have created a test install to try and figure out the component conditions. My installation has 4 files divided into 2 components.

Component 1 is "Sunset.jpg" with Sunset.jpg and Blue hills.jpg
Component 2 is "Water_lilies.jpg" with Water lillies.jpg and Winter.jpg

Component 1 sets the files into directory [TARGETDIR]\Img1 and component 2 into directory [TARGETDIR]\Img2

I set the condition for component 2 to be:

($"Water_lilies.jpg"=3) AND NOT (?"Water_lilies.jpg"=3)

If I run the Install both directories are created and all files are added. If I delete directory Img2 then do a repair Img2 is recreated and the files are readded.

Is there something wrong with my condition or am I trying to do something that can't be done.

Thanks - Brad
Mike
Posts: 292
Joined: Wed Jun 01, 2005 10:50 am
Location: Craiova, Romania
Contact: Website

Hi,

I would suggest another approach.

Set the custom action that deletes the files to run every time, not only on first install. If necessary create a special CA just for this purpose. For this to happen be careful that the CA doesn't have an execution condition and it is an immediate one.

Also, you could check the "Disable Modify" and "Disable Remove" options from the "Product Details" page.

Regards,
Mihai
Mihai Bobaru
Advanced Installer Team
http://www.advancedinstaller.com
egore
Posts: 1
Joined: Tue Dec 13, 2005 8:40 am

BPeters wrote:I am also curious how you would go about disableing the Modify option when an msi file is run after it is installed. Ideally I would like to stop the user from repairing or modifying once installed successfully.
is this possible?
The options that you (Mike) refer to, only disables the Modify/Repair options in the Add or Remove Programs in Control Panel.

Additionally i'm trying to overwrite (or correct) an xml file that was created at installation time but was later modified. The installer repair option does not "re-initialize" the xml file.
Mike
Posts: 292
Joined: Wed Jun 01, 2005 10:50 am
Location: Craiova, Romania
Contact: Website

Hi,

Yes, that is right. You can only disable this functionality in the Control Panel. If the user manually launches the MSI file he is still able to modify it.

Windows Installer does not overwrite a file that has a newer modify date. Whether a file will be over-written or not depends on the file versioning rules. For more information on this issue please see:

http://www.advancedinstaller.com/forums ... .php?t=826

Regards,
Mihai
Mihai Bobaru
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Common Problems”