Renaming an application folder programmatically? - 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!

mrooney
Posts: 3
Joined: Fri Jun 05, 2009 7:59 pm

Renaming an application folder programmatically?

Hello!

I am using Advanced Installer 7.0.1 (enterprise) and we are attempting to automate the building process. I have been able to get everything we change into an ";aic" file with one exception. We have the version number in "Application Folder" and I am looking for a way to change this like we do in the UI by selecting it and hitting F2 (screenshot attached).

In the .aip file this ends up changing <COMPONENT cid="caphyon.advinst.msicomp.MsiDirsComponent"><ROW Directory="ver_3.0.1.2_DIR" Directory_Parent="APPDIR" DefaultDir="ver36~1.1|ver 3.6.1" />

Any tips on this? It isn't 100% clear to me how it generates the DefaultDir attribute from the version number as well so it would be nice if I didn't have to reinvent this algorithm.
Attachments
aidir.png
aidir.png (4.28 KiB) Viewed 2915 times
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Renaming an application folder programmatically?

Hi,

In the folder name you can try using an installer property which contains the version. This way, you can set the property from the command line and the folder name will be set when the project is built. For example, the folder name can be:

Code: Select all

ver [|ProductVersion]
or

Code: Select all

ver [|MY_VERSION]
Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mrooney
Posts: 3
Joined: Fri Jun 05, 2009 7:59 pm

Re: Renaming an application folder programmatically?

Thanks Cosmin! This seems to work pretty well and it gets installed to the correct place, at least on XP SP2. However I did have one question/concern. The .aip file will changes from:

Code: Select all

DefaultDir="ver36~1.3|ver 3.6.3"
to

Code: Select all

DefaultDir="ver36~2.3|ver [|ProductVersion]"
so the first part seems static (the ~1 changes to a ~2 the first time I make this change, but doesn't change later). If the part before the bar (ver36~2.3) is used anywhere, it seems it won't be updated with new versions and could cause problems. My thought was that maybe it is a "legacy" directory name only used on older platforms pre XP (perhaps because they don't support spaces or longer file names?), and if so, we don't support those so it wouldn't be an issue.

Would you be able to clarify the use of the first part of the default dir and if it will cause any problems for us being static? Thanks!
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Renaming an application folder programmatically?

Hi,
so the first part seems static (the ~1 changes to a ~2 the first time I make this change, but doesn't change later). If the part before the bar (ver36~2.3) is used anywhere, it seems it won't be updated with new versions and could cause problems.
This is the shortname of the folder and it's not modified because it doesn't have a practical functionality. It is stored in the project because the MSI needs it. There shouldn't be any problems if this shortname remains the same.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mrooney
Posts: 3
Joined: Fri Jun 05, 2009 7:59 pm

Re: Renaming an application folder programmatically?

Great, sounds good, thanks Cosmin!

Return to “Common Problems”