rename file before it's installed - 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!

aleatorul
Posts: 2
Joined: Wed May 14, 2008 12:52 am

rename file before it's installed

Hi! I'm new to advanced installer and I want to ask for advice:

I want to rename a file it before it is installed and check for some logical arguments. The installer should do this:

pack with it a test.tst file.
check if file test.001 is present on disk, if it is, check if test.002 is present, and so on.
if, let's say, test.003 is not present, it should copy test.tst from it's cab to disk as test.003

How can I do this?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: rename file before it's installed

Hi,

I'm afraid that this is not supported by Windows Installer. Therefore, it can be done only through a Custom Action. This custom action can search for the files on the disk and find out which one needs to be installed. After it finds the missing file it can copy it on the disk and rename it the way you need.

Note that the original file should be placed next to the MSI which runs the custom action. In this case you can get it's location by using the SOURCEDIR property inside your custom action (this property is resolved to the folder from which the MSI is launched).

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
aleatorul
Posts: 2
Joined: Wed May 14, 2008 12:52 am

Re: rename file before it's installed

Thanks. Although... I'm lost. :oops:
Could you please tell me what exactly to set, step by step?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: rename file before it's installed

Hi,

Since a custom action uses custom code written for a specific task, I'm afraid that I cannot offer you an example for the custom action you need. However, if you can write this custom action I can help you use it with Advanced Installer. Note that a custom action is usually written as a VBScript file, a DLL or an EXE.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”