codemonk3y
Posts: 62
Joined: Thu Nov 01, 2012 3:51 pm

Change and Move folder contents on reinstall

Our company name has changed, so the Company Name in Product Info has changed. I have "Use original installation path when upgrading" unchecked. Our old install was in the format: c:\program files\old company\product\app1 and c:\program files\old company\product\app2 . Our new install path is now c:\program files\new company\product .

App1 and App2 have 97% the same files, so we are combining all the files into the product folder. There is the potential there are some files in app1 and app2 folders that i need to make sure get copied to the c:\program files\new company\product . Does this need done in a custom action? How do I reference the old install path if I need to do this in a custom action?

Thanks,
Scott
Eusebiu
Posts: 4959
Joined: Wed Nov 14, 2012 2:04 pm

Re: Change and Move folder contents on reinstall

Hi Scott,

If you want to copy some files during the installation of the product from a folder to another you can follow the steps below:
- go in the Search page and create two "Registry" search for the paths to "App1" and "App2"
- go in the Files and Folders page and create two property-based folders
- in the same page create a "File Copy/Move" operation for each file you want to copy
- build and run the project

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
codemonk3y
Posts: 62
Joined: Thu Nov 01, 2012 3:51 pm

Re: Change and Move folder contents on reinstall

This won't work because I don't know what the files to copy are. I am uninstalling the old version (which was not build with AI) and installing the new application, but in a new folder. The user may have copied files to the original installation folder (some bad legacy programming saves a few files to the installed folder which need moved too).

Would it be possible to keep the "use original installation path when upgrading" and get the install path from [APPDIR] then update [APPDIR] to replace the old company name with the new one?

Thanks,
Scott
Eusebiu
Posts: 4959
Joined: Wed Nov 14, 2012 2:04 pm

Re: Change and Move folder contents on reinstall

Hi Scott,

To do that you can still use the approach I described in my last post with only one difference. The configuration for the "File Copy" operation should be like follows:
  • Source File
    Name: *.*
    Folder: Old Path
    (the old path can be found using a registry search)

    Destination File
    Name: <any name>
    (it is not important)
    Folder: APPDIR
In this case, all the files remained in the old version's folder after uninstallation will be copied in the new version's folder.

Also, if you want the old version to be automatically uninstalled, when the new version is installed, you can go in the Upgrades page, use the [Upgrade] toolbar button and introduce the old version's Upgrade Code.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
codemonk3y
Posts: 62
Joined: Thu Nov 01, 2012 3:51 pm

Re: Change and Move folder contents on reinstall

Thanks. I'll try that.

These folders will only exist on a machine that is being updated. I have properties that the folders point to, but if it's a new install it fails to find the paths. What can I set them to as a place holder?
Eusebiu
Posts: 4959
Joined: Wed Nov 14, 2012 2:04 pm

Re: Change and Move folder contents on reinstall

Hi,

If the folders are not found on the machine the "File Copy" operation will be ignored and the installation will continue normally. The path for the "Application Folder" can be let as it is set by default ([ProgramFilesFolder][Manufacturer]\[ProductName]) if this is what you refer to, otherwise please give me more details.

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

Return to “Common Problems”