Patch to replace 2 files - Advanced Installer Community
opso
Posts: 8
Joined: Thu Apr 19, 2012 10:06 am

Patch to replace 2 files

Hello,

I am trying to create a MSP patch to replace 2 files; I created the MSP package but the same is also replacing other fiels that should not be changed (including the app DB).
What is the way to manyally edit the patch in order to define what files should be replaced?

Thanks, Giuseppe
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Patch to replace 2 files

Hi Giuseppe,

When a patch is created the two MSI packages (the current version and the newer version) are compared, and in the patch will be included only the files that are not identical in both MSIs (only the files that were modified in the newer version will be included). So, your problem may appear if you also modified other files, except for the two files that you want to replace. Please make sure that you followed our Patch Authoring tutorial correctly.

Another solution for you is to create a "fake" patch following the steps below, but in this case the version of your product will not be changed (increased) and the two files added by it will not be removed when your product will be uninstalled:
- create a new MSI package
- in the Product Details page uncheck the "Register product with Windows Installer" option
- in the Files and Folders page add the files you want to replace
- in the Search page use the [Search] toolbar button to create a new search, then use the [Search Location] toolbar button, choose "Registry" and search for the registry entry that contains the path of your installed product (i.e. HKLM\SOFTWARE\Your Company\Your Application\Path)
- go in the Launch Conditions page and in the "Custom" tab use this search as a condition (the patch will not be installed if your application is not already installed)
- go in the Install Parameters page and use this search in the "Application Folder" text field (i.e. [MY_SEARCH])
- build and run the patch

Let us know if this helped, otherwise give us more details about your scenario.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
opso
Posts: 8
Joined: Thu Apr 19, 2012 10:06 am

Re: Patch to replace 2 files

Hi Eusebiu,

I suppose that it is not possible to manually edit MSP package in any way. Is this correct?
One more question: is patch following the directive never overwrite a file?

Thanks, Giuseppe
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Patch to replace 2 files

Hi,
I suppose that it is not possible to manually edit MSP package in any way. Is this correct?
Unfortunately, it is not possible.
One more question: is patch following the directive never overwrite a file?
It happens only if, in the newer version of the application, you go in the "Edit File" dialog (right-click on the file and select "Properties") and in the "Operations" tab select the "Do not overwrite existing file" option.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”