How to convert long filename paths to 8.3 notation? - 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!

LCharlier
Posts: 13
Joined: Fri Jun 12, 2009 8:52 pm
Location: Lafayette, Louisiana, USA
Contact: Website

How to convert long filename paths to 8.3 notation?

I'm sure this has already been answered before yet I have been unable to find any mention of it. I need to specify a path as a command line argument in a shortcut and it must be expressed in 8.3 format (i.e. no embedded spaces). As every other installer I have used previously had this capability as a built-in function, I'm sure it's in here somewhere.

Thanks in advance for any-and-all assistance.

Regards,

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

Re: How to convert long filename paths to 8.3 notation?

Hi Lloyd,

This behavior is not directly supported in Windows Installer. However I have attached a sample that contains a dll to convert the paths from long to short forms and a sample project which demonstrates its usage.

I hope you find it of use.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
LCharlier
Posts: 13
Joined: Fri Jun 12, 2009 8:52 pm
Location: Lafayette, Louisiana, USA
Contact: Website

Re: How to convert long filename paths to 8.3 notation?

Gabriel,

Thank you for the quick response.

Unfortunately, while I have the latest production released version of AI installed, I cannot open the test project you supplied because it was created with an even newer version of your application (v7.4).

Can you post a v7.3.1-compatible version of the test project?

Thanks.

Regards,

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

Re: How to convert long filename paths to 8.3 notation?

Hello,

Yes, sorry about that.
Please find the new attachment below.

Best regards,
Gabriel
Attachments
sample.zip
(492.01 KiB) Downloaded 372 times
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
LCharlier
Posts: 13
Joined: Fri Jun 12, 2009 8:52 pm
Location: Lafayette, Louisiana, USA
Contact: Website

Re: How to convert long filename paths to 8.3 notation?

Gabriel,

Thanks again for the quick response. Unfortunately, my problems still continue - albeit for different reasons. Here is what I'm ultimately trying to do...

I'm installing an application (in APPDIR) and when complete, I need to instantiate a shortcut to the app with a command line argument pointing to a startup script found in the APPDIR alongside the executable - in 8.3 notation (as shown below).
  • [APPDIR]program.exe -s{APPDIR_8.3]script.txt
While the DLL and sample project you provided me with appear to work as advertised, I'm now fighting two new problems:
  • * At the time the DLL is invoked, APPDIR has not yet been created therefore the function call fails.
    * Even if the function call was made after the APPDIR was created, it appears that the shortcut definition is made prior to either the folder creation or the DLL function call.
Any ideas how I might reorder the sequence of events such that I might achieve the result I'm looking for?

Thanks again for your help.

Regards,

Lloyd Charlier
LCharlier
Posts: 13
Joined: Fri Jun 12, 2009 8:52 pm
Location: Lafayette, Louisiana, USA
Contact: Website

Re: How to convert long filename paths to 8.3 notation?

Problem solved. I must admit that, until today, I didn't realize that AI enabled users to rearrange the sequence of the built-in Windows Installer actions. Once I discovered that I could move the CreateShortcuts action down in the overall install sequence, everything worked fine.

Sorry for raising a "non-issue"... :oops:
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: How to convert long filename paths to 8.3 notation?

Hello setup authors,

I am attaching an updated version of the custom action posted in a previous post, along with a sample on how to use it. It should support converting Unicode long paths to short paths (8.3 notation). For it to properly work, make sure your MSI is set to UTF-8 on the Media page->MSI tab->UTF-8 codepage (support Unicode characters to be displayed).

Do let me know if you encounter issues using this.

Best regards,
Gabriel
Attachments
sample.zip
(244.68 KiB) Downloaded 314 times
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”