[SourceDir] silent install - 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!

guya65
Posts: 3
Joined: Tue Feb 19, 2008 2:02 pm

[SourceDir] silent install

I have a simple installer using the silent install option

What I wanted was for the files to be extracted into a subdirectory of the directory that the .msi file is in.

In non silent mode the choose a location correctly fills out from the [SourceDir]test.

However in the Silent mode the [SourceDir] is blank and therefore the installation fails.


Please help as I dont want to hardcode the application directory.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

In order to set the SourceDir property during a silent installation you need to use two custom actions:
- create a ScriptInline custom action under the "InstallExecuteSequence" -> "CostInitialize" standard action (you can see a standard action by using the "Show Standard Action" button on the toolbar)
- in the "Custom Action Properties" page set the "Script Text" field to

Code: Select all

Session.DoAction("ResolveSource")
- set the "Expression" field in the "Execution Condition" section to (Not Installed)
- create a "Directory set with formatted" custom action under "InstallExecuteSequence" -> "CostFinalize"
- in the "Choose Installation Folder" dialog select "Application Folder"
- in the "Custom Action Properties" page set the installation folder (for example "[SourceDir]\test")
- set the "Expression" field in the "Execution Condition" section to (Not Installed)

Note that in this case the application will always be installed in the folder from where the MSI is launched.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”