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!

wakerunner
Posts: 18
Joined: Mon Aug 13, 2007 9:55 pm

Folder name for setup.exe path

Is there a folder name in AI Pro that can be passed as command line to a custom action?

I need to have a custom action start an EXE file and pass it in the command line the path where the install is going, which I see you can pass that, but it also needs to be passed the path to where the setup.exe was launched from. Such as [SETUPEXEDIR], Is that possible with AI?
wakerunner
Posts: 18
Joined: Mon Aug 13, 2007 9:55 pm

[SourceDir]

I found the solution. There is a path that works [SourceDir], but it only works for my purpose if you don't set the option "Include install files in EXE" under bootstrapper options, if that option is checked the [SourceDir] returns the temp folder where the single file setup was unpacked instead of the original location.

I'll put this info here in case somebody else is looking for it.

[SourceDir] behavior:

If "Include install files in EXE" under bootstrapper options is checked: returns the temp folder the single file setup is unpacked to.

If "Include install files in EXE" under bootstrapper options is UNchecked: returns the folder the setup file was launched from.
crairdin
Posts: 15
Joined: Wed Mar 07, 2007 7:26 pm

My experience is similar but more frustrating. I need to run an exe that expects to find files in a subdirectory of the directory from which the setup was launched. My solution was to change the "temporary" directory into which the files are unpacked to ".\install". Then I tell my custom exe to look for its files in "[SourceDir]..\Data".

The problem with that is that the bootstrapper doesn't seem to be able to find or execute the msi if it's not in the default temp folder. If I double click the msi that's in my temp folder it runs fine. It's the exe bootstrapper that fails.

So instead of distributing a nice single-file exe I have to distribute the exe, cab, and msi files.
Ionut
Posts: 605
Joined: Tue Nov 22, 2005 11:29 am
Contact: Website

Hi,

The "SourceDir" is a Windows Installer Property which designates the directory that contains the installation package (the MSI, not the EXE).

If you need to use the directory from where the EXE bootstrapper is running, use the SETUPEXEDIR Property (which is set by the bootstrapper when it launches the MSI):

http://www.advancedinstaller.com/user-g ... -file.html
The problem with that is that the bootstrapper doesn't seem to be able to find or execute the msi if it's not in the default temp folder. If I double click the msi that's in my temp folder it runs fine. It's the exe bootstrapper that fails.
I am not sure I understand what the problem is. Please give me more details about this.

Regards,
Ionut
Denis Toma
Advanced Installer Team
http://www.advancedinstaller.com/
wakerunner
Posts: 18
Joined: Mon Aug 13, 2007 9:55 pm

I don't see that property under the Edit Custom Action parameters.
Quadiago
Posts: 71
Joined: Thu May 31, 2007 9:07 am

Hi.

It won't be there. It is only populated when the install actually runs, so you'll have to type it in yourself: [SETUPEXEDIR] will evaluate to that folder.
Ionut
Posts: 605
Joined: Tue Nov 22, 2005 11:29 am
Contact: Website

Hi,

Indeed, the SETUPEXEDIR Property is set via the command line by the bootstrapper when it launches the MSI package, using a command such as the following:

Code: Select all

msiexec /I "C:\dir\package.msi" SETUPEXEDIR="C:\dir\"
Regards,
Ionut
Denis Toma
Advanced Installer Team
http://www.advancedinstaller.com/
wakerunner
Posts: 18
Joined: Mon Aug 13, 2007 9:55 pm

So can [SETUPEXEDIR] be used as a command line to pass to a custom action?
Ionut
Posts: 605
Joined: Tue Nov 22, 2005 11:29 am
Contact: Website

Hi,

Yes, you can use the Formatted value "[SETUPEXEDIR]" in any field that accepts such a value (for instance, the "Full Path" field for an "EXE with Working Dir" Custom Action).

Regards,
Ionut
Denis Toma
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”