Adding special character in Product details - Advanced Installer Community
akshay karambale
Posts: 49
Joined: Thu May 28, 2020 8:04 am

Adding special character in Product details

hello,
We are facing one error while creating bootstrapper EXE package,

Whenever we are using "|" this special character in Name field of Product deatails page(for example, Name : Sample|FeatureProject) we are getting Error at the time of executting that exe file that is :-
Failed to write in path "path of installation directory" Error: The filename, directoryname, or volume label syntax is incorrect.

I have attached one sample project and screen shot of that error with this post.
So please help me to solve this error, this error is road block for us.

Thanks and Regards
Akshay
Attachments
SampleFeatureProject.zip
(255.14 KiB) Downloaded 297 times
Prerequisites_2.zip
(986.59 KiB) Downloaded 313 times
Prerequisites_1.zip
(1016.93 KiB) Downloaded 474 times
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Adding special character in Product details

Hello,

Unfortunately, Windows does not allow the creation of a file with the specified special character.

You can test this by trying to create a folder by using the pipe character ("|"). The OS should throw the following error:
A file name can't contain any of the following characters:
\/:*?<>|
Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
akshay karambale
Posts: 49
Joined: Thu May 28, 2020 8:04 am

Re: Adding special character in Product details

Hello Catalin,
Thanks for quick reply, Then can you suggest me how we achieve our requirement. I have explaining my requrement bellow,
I have to create Bootstrapper(EXE) package whose display name(the name which shown in ADD or Remove program of control pannel) should contain special character("|")"for example - "Sample|FeatureProject", but as you mentioned in reply that Windows does not support special character. Then is there any alternative way to achieve this ?
Its very helpfull if you provide solution for this, this issue is roadblock for us.

Thanks
Akshay
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Adding special character in Product details

Hello Akshay,

I have done some further research and it looks like the Control Panel accepts special characters such as the pipe character.

However, a Windows document does not. Therefore, what we need to do here is the following:

- remove the ProductName property from the Application Folder path. This path is defined in the "Install Parameters" page:

IP.png
IP.png (32.45 KiB) Viewed 6134 times

- after doing so, we will need to create a custom action that modifies the value of the ProductName (e.g. to replace the pipe character "|" with a space character " ") and then rebuilds the APPDIR property accordingly (without the pipe character so it does not give an error)

As you can see, the default path looks somethine like this:

Code: Select all

[ProgramFilesFolder][Manufacturer]\[ProductName]
where:

- [Manufacturer] = "Product Details" page --> "Publisher" field

- [ProductName] = "Product Details" page --> "Name" field

For instance, a script (PowerShell) that will do what I've mentioned above can look as it follows:

Code: Select all

$progFilesFolder = AI_GetMsiProperty ProgramFilesFolder

$manufacturer = AI_GetMsiProperty Manufacturer

$prodName = AI_GetMsiProperty ProductName


if ($prodName.Contains('|') -eq "True"){

$prodName = $prodName.Replace('|',' ')

}

AI_SetMsiProperty APPDIR "$progFilesFolder$manufacturer\$prodName"
To implement this in Advanced Installer, please go to "Custom Actions" page and add a "PowerShellScriptInline" custom action without sequence.

After doing so, please go to "Dialogs" page --> select "FolderDlg" --> "Init Events" tab and add your custom action there as an "Init Event":

Event: Execute a custom action
Argument: <your_custom_action>
Condition: leave unchanged


CADialogs.png
CADialogs.png (136.36 KiB) Viewed 6134 times

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
akshay karambale
Posts: 49
Joined: Thu May 28, 2020 8:04 am

Re: Adding special character in Product details

Hi Catalin,
Thanks for the reply. I had tried the way you told but this is not worked at my side, I am still facing the same Error. I also want to inform you that We have created one MSI project and in this case it is working fine but while creating Bootstrapper Exe project i am facing this Error, is it Windows does not allow the creation of a file with the specified special character only for the Bootstrapper EXE project?
i have previously posted the sample Boostrapper project if you want to check u can build that project.
so please help me to solve this issue, this is really road block for us.

thanks
akshay.
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Adding special character in Product details

Hello Akshay,

That is a limitation of Windows.

As I have mentioned above, a file name can not contain the pipe character in its name. You can check this by trying to create a folder on your Desktop and renaming it to something containing the pipe character, i.e. My|Folder.

When doing so, an error will be thrown by the operating system.

In what regards the fact that my workaround does not work, could you please forward me the new copy of the .AIP file (the one where you have added what I have presented above) so I can further investigate it?

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
akshay karambale
Posts: 49
Joined: Thu May 28, 2020 8:04 am

Re: Adding special character in Product details

Hi Catalin,
Thanks for the reply. I have attached one sample project with the changes that had you told me to do and in sample project zip there is screen shot of error that i have facing. Just check it once and let me know is there any other changes required to do, and please try to solve my issue as early as possible. waiting for your reply.

Thanks
Akshay
Attachments
Prerequisites_2.zip
(986.59 KiB) Downloaded 322 times
Prerequisites_1.zip
(1016.93 KiB) Downloaded 330 times
SampleFeatureProject.zip
(255.88 KiB) Downloaded 286 times
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Adding special character in Product details

Hello Akshay,

Indeed, this is happening due to the fact that the location where our EXE boostrapper extracts your MSI file contains the ProductName property.

In order to avoid this, please go to "Builds" page --> "Bootstrapper Options" --> "Extract Location" --> remove the "ProductName" property.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”