Changing APPDIR via command line - 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!

markphip
Posts: 20
Joined: Fri Apr 16, 2010 9:03 pm

Changing APPDIR via command line

I have an installer I am trying to automate from our Hudson build server. The APPDIR of my installer is a synchronized folder so that it picks up changes to app files dynamically. This works great.

Now I would like to dynamically control the location it is synching so that I can different versions of build script pull from different location and not hardcode. I cannot seem to do this via command-line:

AdvancedInstaller.com /edit setup64.aip /NewSync APPDIR C:\new64-1.0.0

Exception - This folder is already synchronized.

And /NewFolder just adds an all-new folder and does not remove what was there. How can I do this? Is there a way to have APPDIR refer to a property that I can set?

Mark
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Changing APPDIR via command line

Hi,

What happens is that you first need to reset the synchronized folder APPDIR and then set it to the new location. You cannot set the new location for the synchronization if the folder is already synchronized.

There is not need to have APPDIR refer to another property since reseting the synchronization should do the work.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
markphip
Posts: 20
Joined: Fri Apr 16, 2010 9:03 pm

Re: Changing APPDIR via command line

Bogdan wrote: What happens is that you first need to reset the synchronized folder APPDIR and then set it to the new location. You cannot set the new location for the synchronization if the folder is already synchronized.

There is not need to have APPDIR refer to another property since reseting the synchronization should do the work.
Thanks that worked. When I read the docs, I thought ResetSync was some way to trigger a refresh of the content.

Mark
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Changing APPDIR via command line

Hi,

No, the refresh is done automatically by Advanced Installer when you either open the project in GUI or
when you build the package, either from the GUI or from the command line.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
markphip
Posts: 20
Joined: Fri Apr 16, 2010 9:03 pm

Re: Changing APPDIR via command line

Following up on this issue.

The previous suggestion that I thought worked did not work quite as well as I realized. The problem is that any files from Synched folders that are referenced in the installer do not get pointed to the new location when I reset. IOW, imagine I have an EXE that I am configuring as a service or in a custom action. These items do not have their locations updated. Consequently my build scripts seemed to be working but those files were never being updated in the installer. I did not figure this out until I updated one of those files and it did not come through.

Any ideas on workarounds? Is this a bug?

Mark
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Changing APPDIR via command line

Hi Mark,

This is not a bug. There is no way for us to know the file has moved. We can not tell that a file that has disappeared from a folder and has reappeared in another is one and the same.

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
markphip
Posts: 20
Joined: Fri Apr 16, 2010 9:03 pm

Re: Changing APPDIR via command line

GabrielBarbu wrote: This is not a bug. There is no way for us to know the file has moved. We can not tell that a file that has disappeared from a folder and has reappeared in another is one and the same.
I think it is an exaggeration to say there is "no way" to know what the user intends here. If I add a Synchronized folder "bin" that is pointing to C:\Release1\bin and I use these commands to point it at C:\Release2\bin. And both of these folders have an executable MyApp.exe. I think it is pretty safe to assume what the user intends for you to do.

I am starting to regret convincing my boss to let me buy this product. If the paths in the installer have to effectively be hard-coded to a single location, I do not see how it lends itself to any kind of automation or standard release practices.

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

Re: Changing APPDIR via command line

Hi Mark,
I think it is an exaggeration to say there is "no way" to know what the user intends here.
Unfortunately Windows Installer uses IDs to reference a file in a package. These IDs are generated dynamically based on the package content, so we cannot guarantee that a file will always have the same ID. If the file from the new location uses a different ID, the original reference (for example in a custom action) is invalid.

I'm afraid that there's not much we can do about this. We cannot force a file to always use the same ID and we cannot cache information about all files in the package to determine if the same file was added from a different location.
If the paths in the installer have to effectively be hard-coded to a single location, I do not see how it lends itself to any kind of automation or standard release practices.
Please note installers are usually built around a single disk location, a folder with the application files. For example, a subversion checkout folder. The content of this folder is modified based on your application releases. In your case, the "Release1\bin" folder content should be replaced by the "Release2\bin" content.

You are currently trying to use multiple locations (checkouts) with the same settings, a concept which is not really supported by Windows Installer.

If using the same folder and updating it when necessary is not a solution, you can try using formatted paths instead of file references. For example, you can use:

Code: Select all

[APPDIR]MyApp.exe
instead of:

Code: Select all

[#MyApp.exe]
Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”