Newby Question - 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!

alan
Posts: 1
Joined: Mon Sep 29, 2008 3:31 pm

Newby Question

Hi
I am trying to use Advanced Installer (for a Windows msi file) to include a Custom Action that is a small exe that when run needs the location of text files that contain SQL statements for creating a database and tables. How can I do this? if the sql files are included in the msi (cab) file?

Sorry if this is a really dumb question.

Thanks for any help
Alan
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Newby Question

Hi Alan,

If the EXE can receive the paths of the text files, you can use a "Launch file or open URL" custom action to launch the EXE with a custom command line. In this case the "Command Line" field from the Custom Action Properties page can contain the full path to the executable and its parameters (the paths of the text files).

Since the files are in your package, you can use installer properties to define theirs paths. For example, a file installed in "Application Folder" can use this reference as its path:

Code: Select all

"[APPDIR]MyFile.txt"
Please note that the EXE launched by the custom action can also use installer properties for its path. For example:

Code: Select all

"[ProgramFilesFolder]My Folder\MyApp.exe" "[APPDIR]MyFile1.txt" "[APPDIR]MyFile2.txt"
will be resolved to something like this:

Code: Select all

"C:\Program Files\My Folder\MyApp.exe" "C:\Program Files\Your Company\Your Application\MyFile1.txt" "C:\Program Files\Your Company\Your Application\MyFile2.txt"
Since this custom action uses files installed by the package, it should be scheduled after the "InstallExecuteSequence" -> "InstallFiles" standard action. Please note that Advanced Installer allows you to create SQL connections and run SQL scripts through the SQL Scripts page (this is an Enterprise feature).

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

Return to “Common Problems”