We are switching to use Wise for Windows Installer after many years of using the script based Wise InstallMaster. I thought we were stuffed when I found that the command line compile wouldn't scan folders for added/removed files. Eventually I discoverd that wfwi (the Wise for Windows Installer GUI) is scriptable using OLE.

After a lot of mucking about and consultation of rather incomplete documentation and example (VB) code, I created the following "Hello World" test code which adds a file to the first "Feature", saves the updated .wsi ('source' file), then compiles to generate the .msi (install file).

Note in particular that despite the documentation describing item as a property, it is used as a method to access a given item in a collection ($features->item (0))! Note too that the item index is 0 based.

use strict; use warnings; use Win32::OLE; my $wfwi = Win32::OLE->new ('WFWI.WFWIProject'); $wfwi->Open ('C:\installer\delme.wsi'); my $features = $wfwi->Features (); my $feature = $features->item (0); $feature->AddFile ('C:\source\helloWorld.txt', 'C:\Program Files\targe +t\helloWorld.txt'); my $result = $wfwi->Save ('C:\installer\delme.wsi'); $result = $wfwi->Compile ('C:\installer\delme.msi');

In reply to Automating Wise for Windows Installer - wfwi by GrandFather

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.