Dean
Dean

Reputation:

Unpacking MSI in .Net

I have an installer that deploys web services to IIS. After this has finshed a custom action fires that updates the database with the scripts required by the webservices. The scripts are currently deploying to IIS aswell because they are part of the .net project. How can I configure the installation process so the scripts arn't part of the project and get un-packed from the MSI so my custom action can access them?

Upvotes: 2

Views: 695

Answers (2)

Adrian Clark
Adrian Clark

Reputation: 12489

If you are using the standard Visual Studio setup projects do this:

  1. Add your scripts as files to your setup project
  2. Right-click on the files
  3. Select "Properties"
  4. Change the "PackageAs" property to "vsdpaLoose"

Your files will now be output alongside your MSI so will be available at any time.

Upvotes: 2

CheGueVerra
CheGueVerra

Reputation: 7963

Using WIX, sorry no clue as to what you are using. I would create a

<Binary Id="webServiceScript.sql" src="[DirectoryToFile]\webServiceDataScript.sql" />

After setup a CA to run the script

<CustomAction Id="CallCmd" Value="[Path_to_Exe_Folder][Your_EXE_TO_RUN_SCRIPT_HERE]" />

<CustomAction Id="RunCmd" ExeCommand="webServiceScript.sql" BinaryKey="webServiceScript.sql" Return="Ignore" />

Then just Setup the Installation Sequence

<InstallExecuteSequence>
  <Custom Action="CallCmd" Before="InstallFinalize" />
  <Custom Action="RunCmd" After="CallCmd" />
</InstallExecuteSequence>

Upvotes: 0

Related Questions