dorukar
Posts: 12
Joined: Thu Sep 20, 2007 1:37 pm

file modification after build?

Hi, I have a project which has 70000 files in it. After building it, I need to modify one of the files. Is there any way for doing this without a new build operation, because, the each build operation takes about 4 hours.

Thanks for your assistance.

Doruk AR
CENG
Media Team
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

I'm afraid that the changes made to a file after building your project will not be visible because the file has already been included in the installation package in the original state.

However, this can be done with a "File Copy/Move" file operation:
- you create your MSI package without the file that needs to be modified
- in the Advanced Installer project, in the "Install Parameters" page, you create the SOURCEDIR property (the value doesn't matter because it will be set at runtime)
- in the "Files and Folders" page you create a property-based folder using SOURCEDIR
- in the APPDIR folder you create a "File Copy/Move" operation (you can use the "New File Operation" button on the toolbar) that looks like this:

Source File
Name: test.txt (you will replace this with your file)
Folder: SOURCEDIR (you can select it using the "..." button)
Destination File
Name: test.txt
Folder: APPDIR (or the property of the folder which will contain your file)
Properties
Component: application.exe (you will choose from the combo box a component that is always installed)
Operation: Copy

Note that the file must be placed next to the MSI installation package.

Let me know if you encounter any problems.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ACarpenter@msn.com
Posts: 15
Joined: Sat Aug 11, 2007 12:59 am

I've been playing with the whole copy file issue for half a day now and have finally realized that it DOESN'T work if you have a bootstrapper checking for pre-requisites.

I assume this is because the bootstrapper doesn't know any of variables created by the custom actions in the actual msi.

I've tried creating the msi OUTSIDE the bootstrapper with no success - it would appear that you can check for prerequisites (bootstrapper) AND run the necessary packages, OR you can create custom actions, but you can't do BOTH.

Anyway around this?

Thanks.

Carp
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

Please note that if the installation is launched through the bootstrapper, you need to use the SETUPEXEDIR property instead of "SourceDir".

Note that these properties (SETUPEXEDIR and SOURCEDIR) are available only after the "CostInitialize" standard action and they cannot be used in deferred custom actions.

Also, I'm not sure what custom actions you are referring to. Can you please give me more details about this?

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
AnneTheAgile
Posts: 61
Joined: Wed Jun 08, 2011 9:53 pm

Re: file modification after build?

Radu was nicely offering me help offline and I thought maybe i should post it to the forum.

I'm trying to paste modified files into my installation appdir, after the regular install is done. I could not do it with this;
>To achieve what you want you can follow our "Install a user specific file" article steps.
http://www.advancedinstaller.com/user-g ... -file.html

In the instructions, this part I did not quite understand, and maybe it's why I failed:
> The [flavored file] should be placed next to the MSI installation package when launch your MSI

I want the installer to handle which file is posted and the flavoring, but does this mean that I cannot do that? Does "next to" mean it cannot live in the installer?
Thank you!
CIB-550
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: file modification after build?

Hello Anne,
I want the installer to handle which file is posted and the flavoring, but does this mean that I cannot do that? Does "next to" mean it cannot live in the installer?
Yes, you are right. The above scenario is used for files that are not added into your installation project. The file should reside next to your built installation package at run time. So, when the installer is launched on target computer the above file will be searched in the location where the installer is launched from, and if it is found will be copied in the installation folders.

Can you please give us more details about what you are trying to achieve (maybe exemplify)?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
AnneTheAgile
Posts: 61
Joined: Wed Jun 08, 2011 9:53 pm

Re: file modification after build?

I'm essentially trying to flavor a configuration file to be machine-specific. The regex pattern in the ComputerName tells me what kind of deployment options it should use. So, given that computation of Flavor, then I want to edit config files to include the proper values. I didn't want to use the nice XML edit because the syntax of the replacement comes out nearly to the entire file. So it seems easier to manage the flavors in the operating system rather than in an XML file inside AIP.
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: file modification after build?

Hello Anne,

In order to achieve what you want you can try a similar approach like the one explained in our "alter XML file content based on radiobox in dialog" thread.

Also, if this is not a suitable approach you can add in "Files and Folders" page all your config files and, then from "Organization" page you can set install condition accordingly for all config files components. Please take a look on our "Install files with the same name" article which could be useful for you.

If you have any questions let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”