0

I am new to software development (though not programming). I am in the process of delivering my first application for commercial release, and I am in need of a single-click installer package. I looked into a number of solutions - I coded my own in C# (it basically just grabs my three folders to their respective destinations), but ran into some issues with bundling some IO libraries. Since I am using Visual Studio Express 2012, I cannot use the InstallShield module. I found WiX, and while it has some tutorials online, the learning curve of this service is pretty high - it's safe to say I am pretty confused.

I have three folders:

  1. myApplication2013 folder
  2. myApplication2014 folder
  3. System.Data.SQLite.dll

The logic of my C# code is the following:

public static void installer(){
        deleteLegacyFiles(); // deletes legacy myApplication directories and files
        moveSQLite(); // moves system.data.sqlite database to directory
        if(checkRevit2013()){ // install myApplication 2013 if Revit 2013 is installed
            moveMyApplication2013();
        }else if(checkRevit2014()){ // if Revit 2014 is installed, install myApplication 2014
            moveTally2014();
        }else{ // tell user both Revit 2014 and Revit 2013 is not installed
            System.out.println("It does not look like you have either Revit 2013 or Revit 2014 installed.");
        }
    }

The target location will be specified by the .msi, as for the target locations:

  1. myApplication-2013 is: C:\\ProgramData\\Autodesk\\REVIT\\Addins\\2013
  2. myApplication-2014 is: C:\\ProgramData\\Autodesk\\REVIT\\Addins\\2014
  3. System.Data.SQLite.dll is: C:\\Windows\\Microsoft.NET\\assembly\\GAC_64

What the installer really does is it takes the source folders/files (from the 3 above) and literally copies them to the target location. This is also what my C# script does (though it uses the IO library). What are the steps I need to for WiX? I am so confused.

I also need to create a merge module.

Thank you.

theGreenCabbage
  • 5,197
  • 19
  • 79
  • 169
  • 1
    Simply running [Heat](http://wixtoolset.org/documentation/manual/v3/overview/heat.html) on your folder structure is not enough to get started? – rene Oct 28 '13 at 20:21
  • Sorry - what is Heat, and what does it do? – theGreenCabbage Oct 28 '13 at 20:27
  • Heat is the harvester. If you follow the link I provided you'll see that it produces a wxs file for you based on the files it finds in a folder structure. The wxs file can then be linked (with light) and compiled (with candle) to a msi file. By lookig at the wxs file that is generated you can learn a lot and extended easily – rene Oct 28 '13 at 20:40

1 Answers1

2

My open source tool ISWIX has project templates in Visual Studio to aid in stubbing out your installer. There is also a graphical UI for authoring the files into the merge module. Here' a article with steps and video that shows you what the experience is like.

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100
  • Hi Christopher. I am fairly new to the software development industry (so this is my first time creating an installer). Could you tell me what a merge module is, what how I can create that through Visual Studio Express 2012? For my needs, what code sample do you think I should refer to? – theGreenCabbage Oct 28 '13 at 20:26
  • VS Express is locked down. But if you install the VS Isolated Shell then yes, I'll register my project templates with that. So maintain your .NET code in Visual Studio Express and your installer code in Visual Studio Isolated Shell. http://blog.iswix.com/2011/03/installation-collaboration-workflows.html – Christopher Painter Oct 28 '13 at 20:46
  • Thanks for the answer @Christopher Painter. However, could you explain to me what a merge module is and what it does? I am submitting this application to Autodesk soon, and alongside the msi installer, I also need to submit a msm merge module. – theGreenCabbage Oct 28 '13 at 20:49
  • A merge module is like a .LIB in C/C++. It's an encapsulation of a collection of components that gets merged into an MSI. You create a Merge Module projects to build the .MSM and you create a Setup Project to create the MSI and everything in the MSM gets consumed into the MSI at build time. It's a way of splitting your code out into multiple reusable projects. (Like a .DLL but it gets statically linked not dynamically loaded at install time.) – Christopher Painter Oct 28 '13 at 20:51
  • Could you perhaps contextualize the explanation of the merge module based on what my installer needs to do, which in particular, is simply dragging DLLs and directories to the `/Addins/` folder of `/REVIT/`? – theGreenCabbage Oct 28 '13 at 20:54
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/40139/discussion-between-thegreencabbage-and-christopher-painter) – theGreenCabbage Oct 28 '13 at 20:56