2

(I'm using InstallShield2012 V.18)

In setup.rul I defined a function per prototype declaration, included the file with the function definition and compiled it successfully (InstallShield compile).

Now I'd like to test this function (only). I don't want to run the whole installation, not even test (Ctrl-T) because I want to avoid a complete re-build which takes too long time to do it often.

Is there a way to test only the custom function in InstallShield or per command line?

Mayoares
  • 1,234
  • 2
  • 13
  • 21
  • This is late, but as I'm currently researching the question, I thought I'd post a response. In my experience, you should try to avoid InstallScript as much as possible, as it is not easily testable. I understand that sometimes it is a necessary evil, though. To that end, it's probably helpful to extract your custom action logic to an outside .dll (e.g. C++ or C#). This custom action library could then incorporate actual test frameworks, so that you could more easily test various cases. – losmescaleros Oct 09 '15 at 17:42

2 Answers2

2

Not really although I can give you some tips.

  1. Create a dummy feature with a release flag of DEVONLY.
  2. Create a dummy component for that feature.
  3. Create a ProductConfiguration that builds a single MSI with no EXE and a release flag of DEVONLY.

Building this production configuration will be very fast. A couple seconds on my laptop with an SSD. You can selectivly include other features through the use of release flags if you need certain components in order to setup the test environment for your CA.

Another strategy is to develop your CA in a test harness project and then transplant the code into your real installer when you know it all works.

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100
0

Christopher, thanks for this fast reply. I have to put my answer here because commenting was restricted, because too long.

I also thought about using such a workaround but first wanted to avoid it if possible. But ok, now I tried these steps, 1 and 2 no problem, but 3: InstallShield didn't allow me to configure a Product Configuration without Setup.exe in my .ism file (although we have IS2012 Pro).

Then I tried to do it in a Basic MSI Project (is that what you meant?), which really builds in very short time. And now I can see my scripting during Test Release, yeah :-)

To "transplant" my script now to the main ism I'm missing an export function for .rul files as it exists for custom actions, but there is only a import. So I will have to copy-paste while switching between ism files, but never mind.

Mayoares
  • 1,234
  • 2
  • 13
  • 21
  • Copy and paste is what I meant when I said transplant. You must have a project setting such as multiple language support that requires setup.exe You can build an uncompressed media then. The point is to build something that builds fast. – Christopher Painter Mar 23 '12 at 11:18