cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Pete_Delgado
Level 4

Dumb behavior of automation interface

While creating a Windows Script Host script that will update an existing InstallShiled project based upon the current contents of a build environment, I came across this gem of the automation interface while trying to discover whether a particular component already contained a specific file:

"Unfortunately, you might not know the file key, or it might have been reassigned if the files are dynamically linked to the component. Instead of using the file key, you could write code similar to the following example to check for a certain file name:

Dim m_pFile As ISWiFile
For Each m_pFile In m_pComponent.ISWiFiles
If UCase(m_pFile.DisplayName) = "MYFILE.EXE" Then
Exit For
End If
Next

"
Now imagine a folder that contains thousands of files. A novice might use the suggestion to use the above code to check for the existance of a file only to find that the script takes hours or even days to run!

Why on earth make the file key an indexer into the Component.ISWiFiles collection rather than the file name? Is there a single compelling reason why this was done and if not, can this behavior be changed because I'm sure that this functionality isn't used by anyone!

As it stands, I had to cache the collection in order to obtain acceptable performance. While this works, it increases the complexity of the code and should be unnecessary...

Another fun fact is that the ISWiComponent object method RemoveFile accepts only an ISWiFile object which means that you must go through the same idiotic steps to remove a file as well...

-Pete
Labels (1)
0 Kudos
(4) Replies
Christopher_Pai
Level 16

The automation interface is somewhere between mostly usable and well, interesting. I've found a few things it did intuitively and a few things that were missing, wrong, or my favorite generate modal error dialogboxes instead of raising exceptions.

Seriously, if you have to have "premiere" to have the SAB, I can only imagine what small percentage of developers are actually sophisticated enough to be making use of the automation layer.

For me I use WiX documents to build installers. 🙂
0 Kudos
Pete_Delgado
Level 4

Christopher Painter wrote:
The automation interface is somewhere between mostly usable and well, interesting. I've found a few things it did intuitively and a few things that were missing, wrong, or my favorite generate modal error dialogboxes instead of raising exceptions.

Seriously, if you have to have "premiere" to have the SAB, I can only imagine what small percentage of developers are actually sophisticated enough to be making use of the automation layer.

For me I use WiX documents to build installers. 🙂


Christopher,
For the most part, I find the automation interface usable, but there are certain things like displaying message boxes instead of returning error codes that I find frustrating as you do! My scripts are intended to run unattended and having the automation layer report a warning or error via a message box defeats the purpose of even having the automation layer!

I've used Wix for a variety of projects in the past, but got away from it a little. I probably need to get back into it because quite honestly I'm angry and frustrated with InstallShield over the pricing for "upgrades" as well as the fact that the databases that are created have so much clutter in them that is never used for the vast majority of the installers we create. I always feel like we are paying for functionality that we will never use!

I think my two biggest complaints about Wix were the fact that there was no GUI environment to develop interfaces and no easy way to determine the contents of cab files for installers that spanned multiple disks.

There now appear to be several commercial and free tools to create pleasing GUIs which eliminates that complaint. I still haven't seen anything that addresses my second complaint though now that I think about it, it wouldn't be that difficult to create a tool that creates the cab files and then generates the Wix sequence numbers and disk IDs based upon the created cabs. Once created, they can be cached... Hmmm... 🙂

-Pete
0 Kudos
Christopher_Pai
Level 16

I hear you. I personally like to blend WiX and InstallShield with a goal of moving towards pure WiX over the next few years. Stay tuned as I'm working on releasing my own WiX Editor in the coming weeks. It's not an InstallShield killer at this point but it'll let you do much of the heavy lifting until I get more designers created.
0 Kudos
Pete_Delgado
Level 4

Christopher Painter wrote:
I hear you. I personally like to blend WiX and InstallShield with a goal of moving towards pure WiX over the next few years. Stay tuned as I'm working on releasing my own WiX Editor in the coming weeks. It's not an InstallShield killer at this point but it'll let you do much of the heavy lifting until I get more designers created.


Sounds interesting. I'll check it out!

-Pete
0 Kudos