Since I have always in the past done repacakging work this question has never come up before, but now I am putting together an MSI for a vendor, I would like to know if it is possible to pull a file from the destination PC in an MSI.

The scenario is this, I have an appsearch function to check for the existence of a previous installation (this will be the first MSI release), if a previous version exists I would like to nab a couple of ini files during the UISequence which I will later merge with ini files in my installation using a custom action.  I understand I can interrogate ini files which exist in the C:\Windows folder using appsearch but is it possible to actually copy a file into an MSI?

Answer Summary:
Afaik you cannot 'dynamically' put files from the destination machine into your MSI (as files). What you can do is read in their contents in a Custom Action and then apply the required modification there. Then I would condition both your default ini file components (if you have any) and the Custom Action that modifies existing ones on the result of your system search. That way, if there are ini files present, you modify them, if not, you put your defaults in place..
Cancel
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Community Chosen Answer

1

Afaik you cannot 'dynamically' put files from the destination machine into your MSI (as files). What you can do is read in their contents in a Custom Action and then apply the required modification there. Then I would condition both your default ini file components (if you have any) and the Custom Action that modifies existing ones on the result of your system search. That way, if there are ini files present, you modify them, if not, you put your defaults in place..

Answered 05/11/2012 by: pjgeutjens
Red Belt

  • Thanks, that makes sense, I was just struggling with the logic and method on a Friday afternoon, I'll give that a go.
Please log in to comment

Answers

0

Sorry, I should clarify, the reason I want to avoid using the ini file table is that there are not only hundreds of possible entries in these ini files (not necessarily a problem in itself) but also because these files may have been installed in some pretty shonky destinations in the past.

Answered 05/11/2012 by: shields_t
Senior Purple Belt

Please log in to comment
Answer this question or Comment on this question for clarity