Creating an MSI Package Using a Visual Studio Setup Project

You can create an MSI package by using a Visual Studio Setup project and then using ORCA to edit the properties of your MSI package. You need to edit the MSI package properties so that you can add the WHSLogo property. Adding this property and setting it to a value of 1 enables Windows Home Server to recognize the MSI package as a Windows Home Server add-in. For information about how to download and use ORCA, see the MSDN Web site (https://go.microsoft.com/fwlink/?LinkId=94640).

Step 1: Add a Visual Studio Setup project to your solution

To add a Setup project

  1. With the SDKSample Visual Studio solution open, right-click Solution 'SDKSample' (1 project), point to Add, and then click New Project.

  2. In the Add New Project dialog box, select Setup and Deployment Projects in the Project Type pane, and then select Setup Project in the Templates pane.

  3. For the purposes of this walkthrough, name your project InstallSDKSample.

  4. Click OK to close the Add New Project dialog.

Step 2: Add project output to the Setup project

To add project output

  1. In the File System editor, select the Application Folder node. If you do not see the File System editor, right-click your InstallSDKSample project in the Solution Explorer, point to View, then select File System.

  2. Right-click the Application Folder, point to Add, then select Project Output.

  3. In the Add Project Output Group dialog, verify that Project is SDKSample, and that Primary Output is highlighted. Click OK to add the project output and close the dialog box.

Step 3: Set the default location in the Application Folder properties

In the File System editor, right-click Application Folder and then click Properties Window. In the properties window, in DefaultLocation, type [ProgramFilesFolder]\Windows Home Server. This ensures that your application files go to the correct directory on the server.

Step 4: Exclude the HomeServerExt.dll and the Microsoft.HomeServer.SDK.Interop.v1.dll from the Detected Dependencies of your InstallSDKSample project

In the Solution Explorer, expand the Detected Dependencies node in your InstallSDKSample project. Right-click HomeServerExt.dll, then click Exclude. Do the same for Microsoft.HomeServer.SDK.Interop.v1.dll. This sets their Exclude property to True.

Important

If you skip this step, your add-in will install properly. However, if you decide to uninstall it, the HomeServerExt.dll and the Microsoft.HomeServer.SDK.Interop.v1.dll will be entirely uninstalled from your Windows Home Server. Windows Home Server does not run without these files.

Step 5: Build the SDKSample solution

To build the SDKSample solution

  1. On the main menu, click File, and then click Save All.

  2. On the main menu, click Build, and then click Configuration Manager.

  3. In the Configuration Manager dialog, in Configuration, click InstallSDKSample, and then click Release. Do the same for SDKSample.

  4. Make sure the Build check boxes are checked for both projects.

  5. Click Close to close the Configuration Manager dialog.

  6. Right-click Solution 'SDKSample' (2 projects), and then click Build Solution. If any build errors occur, correct them before continuing.

  7. When the build finishes successfully, navigate to YourVisualStudioProjects\SDKSample\InstallSDKSample\Release (where YourVisualStudioProjects is the location of your Visual Studio projects).

  8. Verify that the InstallSDKSample.msi file is created. You will copy this file to the server in the Deploying the Add-In MSI section of this tutorial.

Step 6: Edit the MSI package using ORCA

You need to edit the MSI package properties so that you can add the WHSLogo property. Adding this property and setting it to a value of 1 enables Windows Home Server to recognize the MSI package as a Windows Home Server add-in. For information about how to download and use ORCA, see the MSDN Web site (https://go.microsoft.com/fwlink/?LinkId=94640).

Note

If you rebuild your solution in Visual Studio after adding the WHSLogo property, the change will be lost and you will need to repeat this step.

To edit an MSI package by using ORCA

  1. With ORCA open, click File, click Open, browse to the location of the MSI file that contains your Add-in, and then click Open.

  2. In the Tables column, click Property.

  3. Right-click anywhere in the column area where the Property and Value columns are listed, and then click Add Row.

  4. In the Add Row dialog, type WHSLogo for the Property, click Value, and then type 1. Click OK to enter the property and to close the dialog.

  5. Click File, click Save, and then click Exit to close ORCA.

Step 7: (Optional) Create an End User License Agreement

You can include an End User License Agreement (EULA) with your MSI package. To include a EULA with your MSI package, the EULA text must be saved in a file of Rich Text Format (.rtf), and it must have the same name as the MSI file. For example, to create a EULA for the InstallSDKSample.msi, you create an InstallSDKSample.rtf file.

You will deploy the EULA file when you deploy the MSI file.

Your MSI package is now complete. Continue to the Deploying the Add-In MSI section of this tutorial.