[Sourcedir] not passed to a .bat in order to compose a windows path - Advanced Installer Community
fabiensen
Posts: 1
Joined: Mon Jan 02, 2017 9:36 pm

[Sourcedir] not passed to a .bat in order to compose a windows path

I'm using Advanced Installer to create an MSI installer. At the very end of the process of the installation, I need to launch a .bat file with a variable from Advanced Installer, that is the Windows Path where the MSI is [Sourcedir]. The variable is usually passed correctly, I can see in a dummy .bat file. However, in the following situation I get an error, which is not debugged from the AI log nor from the command terminal itself.

The .bat file has this content:

move %1\client c:\xampp\htodcs

That is, move the client directory, which is in the same path of the MSI, to htdocs inside xampp. For some reason this fails, I think it may depend on a bad formed path or maybe backslash is a kind of escape... I repeat, can't debug it from AI and I am not a Windows expert unfortunately, but I can ensure the variable is passed correctly to other test .bat files.

Could you please help me?

Kind Regards
Fabio Ricci
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: [Sourcedir] not passed to a .bat in order to compose a windows path

Hi Fabio and welcome to Advanced Installer forums,

If a property value contains spaces it must be enclosed in quotation marks. Is this your case too?

Can you please try to display the value of the property in the bat file? Use the echo command line e.g.:

Code: Select all

echo %1\client 
In order to have a better view about this, please send us the .AIP(project file) to support at advancedinstaller dot com so we can investigate it? If it contains confidential information you can send us a small test project which reproduce this behavior.

To launch a .bat file, you can also take a look on the How to launch a CMD or BAT file? article with related information for hints and guidance.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”