Custom install using Visual Studio Installer?

Share your favorite tips, workarounds and shortcuts for theWord
zcudaniel
Posts: 19
Joined: Thu Dec 23, 2010 12:41 am
Location: Clearwater, FL USA
Contact:

Custom install using Visual Studio Installer?

Post by zcudaniel »

Hi, our fellowship of churches has written 90+ books on Christian subjects and I am looking for a better distribution platform than our current custom made system. Currently are using an application we developed in Visual Studio to view our books as PDF files. The limitation to this is that books can only be searched one at a time. Our goal is to find something that would allow users to install the books as a "package" that would be searchable.

After researching the capabilities of TheWord it seems as if a viable solution would be to make a compact installation that would include a pre-built module set containing our books. This could be simply copied to a user's computer using whatever method that is convenient. From what I understand, a user can run a compact installation without going through the actual installation process.

Has anyone ever considered wrapping a compact installation in a Visual Studio Installer? This would simply perform the functions of transferring the program from an installation CD to the folder of your choosing with the option of placing an icon on the desktop. I don't think it would offer the option of uninstalling though.

Does anyone have any opinions about this method or any options that would better suit our needs? Is just copying a compact installation a good solution for our users? I would love to hear any ideas or solutions that others have come up with.

Thanks,
Daniel
Darwin
Posts: 57
Joined: Tue Feb 02, 2010 10:57 pm

Re: Custom install using Visual Studio Installer?

Post by Darwin »

Daniel,
What you are talking about is precisely the idea of the toolkit and module installer that you found on the other threads. My interest is to support the rapid dissemination of theWord by making it so that the software installs and module installs are: *) easy for anyone to prepare, *) seamless for your target user community to consume.

This is also exactly what I do for training.

One thing you should realize is that using any type of formal installer platform will "unnecessarily" trigger "installer detection" and "UAC elevation" on Windows 7 (and Vista). (By way of background, I create and teach the Windows Installer courses at DesktopEngineer dot com and the Windows 7 application internals, installation and virtualization courses at CSI-Windows dot com.)

My script still triggers UAC because there is just one registry key change that is made by a the compact installer from theword.gr for which admin rights are required. This is the registry key for install folder ("HKLM\Software\The Word\Dir"). If you leave this out you have a kind of hybrid compact - portable install - one that has shortcuts to it, but does not have the registry key.

The registry key is ONLY used for future book installers in the setup.exe format.

So IF your intended audience will only consume your books - you can TOTALLY avoid UAC prompts and EXE based installers for BOTH theWord and future book upgrades by allowing the CD Toolkit to install Module Installer.vbs. You can then distribute modules using TWZIP files (renamed ZIP files) as discussed in this thread: viewtopic.php?f=2&t=2629

If you stay away from installer altogether you make your preparation for distribution MUCH easier - both for your standard install and for future books.

One caveat is that upgrading the configuration of an existing install in the future is challenging - but it would be with standard installation technology as well. One example is adding "views". My training distribution has custom views - but since they are deployed with the customize compact install, it works fine. I also have a floating book view that explains the training build - kind of like an "intro" splash screen - but it's a whole book (tutorial lessons in this case).

To completely avoid UAC and EXE installers for this very scenario I have also talked to Costas about supporting the Dir registry key as an override in HKCU for book installers and he is agreeable - but it will take time for all the standard installer's to be updated and for individuals making EXEs installers to check both places.

I hope the toolkit is helpful for you and I will be as responsive as possible to any challenges you have implementing it.

D.

CD/DVD/Distribution Toolkit (Include module installer): http://c2674932.cdn.cloudfiles.rackspac ... oolkit.zip

Self-extracting EXE for Module Installer: http://c2674932.cdn.cloudfiles.rackspac ... leInst.exe
zcudaniel
Posts: 19
Joined: Thu Dec 23, 2010 12:41 am
Location: Clearwater, FL USA
Contact:

Re: Custom install using Visual Studio Installer?

Post by zcudaniel »

Hi Darwin,

I have been considering this and I am beginning to wonder if the real problem is upgrades. If I distribute a custom installation that installs to My Documents by default, then the user sees there is an update and unwittingly performs a normal installation, major problems will happen. It will seem like the books have been replaced with the default Bibles, etc even though the program still resides in My Documents. What are your thoughts on this scenario?

Has there been any thoughts on creating an installer that installs a package of books into a normal installation? That way a user could perform all updates and still install the desired group of books. The real key for us to to be able to install all books at once without a prompt to put them into the proper module. Our install would be over 90 books so even using the EZ Module Installer would not be viable.

What do you think?

Thanks,
Daniel
Darwin
Posts: 57
Joined: Tue Feb 02, 2010 10:57 pm

Re: Custom install using Visual Studio Installer?

Post by Darwin »

I upgrade the compact installs I maintain with the standard minimal installer.

Nothing is replaced unless it has the same name - so you would just have to make sure that your custom modules have relatively unique names.

Also, I stand corrected. The Dir folder value is used during an upgrade installer as well. So if you make sure that it is there, then upgrade installers will simply upgrade your compact install - they are designed to install over an existing install and in my experience have never hammered any customizations I have.

The TWZIP files can have as many modules as you want in them. Folder structures in the ZIP are ignored, but can help for your internal / backend management of grouped resources. You can zip sub-sets of folders containing modules depending on the intent of the TWZIP distribution - e.g. "All Chinese Resources"

D.
zcudaniel
Posts: 19
Joined: Thu Dec 23, 2010 12:41 am
Location: Clearwater, FL USA
Contact:

Re: Custom install using Visual Studio Installer?

Post by zcudaniel »

I got you. It is a smart installation with the new installer looking for previous install directories even if it is compact. That is a nice feature.

I did have a question about the TWZIP files. If we went that route, is there a way to install them into a custom module? For example, if a user already has 100 books in his installation, our group of books would become lost in the regular book module.

Thanks for all of your help and advice!
Daniel
Darwin
Posts: 57
Joined: Tue Feb 02, 2010 10:57 pm

Re: Custom install using Visual Studio Installer?

Post by Darwin »

I think you mean a custom "Book view", as modules are the individual .TWM files.

The short answer is "no" - but I believe it is also "no" for any solution at this point. (Costas can correct me if needed).

What you are thinking of requires merging configuration data. This is fairly easy for the parts of it stored in config.ini, more challenging for the parts stored in sqlite database files.

Most likely you would want a custom "Module Set" that could be easily configured into a new book view.

Custom modules sets appear to be configured in config.ini under headings like [BTL.<your set name>] and views under headings like [tlbx._book_view_2]

If this is the only place their configuration is specified, then in theory you could maintain a custom module set and book view this way. However, I am not aware of how (or if) you can create named book views.

I have use some INI class objects in vbscript. Perhaps a routine could be made to do a config.ini merge where you provided a partial config.ini that updates only the target sections - once again avoiding setup builder tools, just place a partial config.ini in the distribution.

It might be best to pair this with custom layout so that the user can always choose that custom view to bring back your specific book view.

Layouts are more challenging, they are in a sqlite database file. I previously did the initial research to merge additional layouts which are stored in a sqlite3 database file called "my.lyts.twm". sqlite3.exe needs to tag along.

You should understand that no matter what tool you choose, the challenge of merging a configuration with an existing configuration will be the same - because, as far as I know, there is no provided method for merging configuration information.

If you choose a "REAL" setup technology you will needlessly run into the UAC challenges I mentioned before. (Calling Visual Studio Installer a "REAL" setup technology is a huge stretch - but in regard to triggering bad things on Windows 7, it is the same problem.)

I have thought of re-writing my existing framework in AutoIt - one of the advantages (besides being very easy to learn and compiling to EXEs) is that it will not automatically trigger installer detection. This would also make the scripts I've been doing more compatible with Mac distribution since VBScript on WINE requires extra configuration steps.

I do not have bandwidth for such ambitions at this point in time - but if you are able to limit your scope to not needing to do configuration merges, you could use the scripts I have provided.

D.
csterg
Site Admin
Posts: 8627
Joined: Tue Aug 29, 2006 3:09 pm
Location: Corfu, Greece
Contact:

Re: Custom install using Visual Studio Installer?

Post by csterg »

Just a point concerning custom book sets and views:
yes, it's all possible; It will need tweaking the config.ini and the layouts (sqlite) but this not as hard as it may look. If needed i can guide,
Costas
Darwin
Posts: 57
Joined: Tue Feb 02, 2010 10:57 pm

Re: Custom install using Visual Studio Installer?

Post by Darwin »

Costas,
When I get time, I would like to enhance the installer script I have built to process "config.ini" and "my.lyts.twm" by merging them into the existing one.

A quick search turned up a VBScript class just published in August that can do the INI merge with very minimal code (http://www.codeproject.com/KB/files/VB_ ... bject.aspx).

A couple quick questions:

Can book views be given a custom name if editing config.ini directly?

What configuration changes would be necessary to make a specific book view float, centered on the screen ?

Thanks much,
D.

P.S. - thanks for keeping old posts editable forever - big help in cleaning up the dead links in my previous posts.
zcudaniel
Posts: 19
Joined: Thu Dec 23, 2010 12:41 am
Location: Clearwater, FL USA
Contact:

Re: Custom install using Visual Studio Installer?

Post by zcudaniel »

Hi Darwin, yes you are right, it is a "module set" that I am referring to. In reality I am just looking for the best, easiest way for users to install our books into a custom module set for use with TW.

Costas and Darwin, I would be very interested in developing such an installation. I do have some programming and database experience but would definitely need your help/guidance to develop something like that.

Thanks and merry Christmas!
Daniel
csterg
Site Admin
Posts: 8627
Joined: Tue Aug 29, 2006 3:09 pm
Location: Corfu, Greece
Contact:

Re: Custom install using Visual Studio Installer?

Post by csterg »

Darwin wrote: Can book views be given a custom name if editing config.ini directly?
I think yes. Start with a section tlbx._book_view_dock_XXX (defines window position, e.g. ex.floating=1 if you want it to float), then create a tlbx._book_view_XXX with specific book view properties. I haven't tried it, but i think the XXX just needs to be unique (i think).
What configuration changes would be necessary to make a specific book view float, centered on the screen ?
ex.floating=1
FloatLeft=xxx
FloatTop=xxx

Costas
Darwin
Posts: 57
Joined: Tue Feb 02, 2010 10:57 pm

Re: Custom install using Visual Studio Installer?

Post by Darwin »

Earlier today I did update the module installer code with some simple code for merging INIs. However, it seems I've discovered a bug in the VBScript INI Class as it does a full replace instead of merge. I have reported it to the author and if they fix it, then doing a config.ini merge as part of a TWZIP file is already be done.

If you make sure to include a custom view that references your book module in your first distribution, then you may not need to worry about updating a sqlite db file for quite a while.

Also, Module Installer can already be called from another script with a /Z:<filename>.twzip - so you could support a single TWZIP file for both initial installation of the compact install as well as integration into existing installs (ones that download and install the module installer). Currently the compact install script (CopyPreconfiguredCompactInstall.vbs) does not support compressed source files - so this would be a way to make the bulk of the install (all the books and bibles) be compressed.

Daniel - have you worked with VB or VBScript before?

If so, maybe you could take a stab at debugging the VBScript code here: http://www.codeproject.com/KB/files/VB_ ... bject.aspx

When using these lines of code:

Code: Select all

Set ini = New IniFile
Call ini.Load("c:\test\config.ini", False)
Call ini.Load("c:\test\configpartial.ini", True)
Call ini.Save("c:\test\config.ini")
When I do this I get a complete overwrite of config.ini by the contents of configpartial.ini instead of the merge that should happen.

D.
zcudaniel
Posts: 19
Joined: Thu Dec 23, 2010 12:41 am
Location: Clearwater, FL USA
Contact:

Re: Custom install using Visual Studio Installer?

Post by zcudaniel »

Could this be solved by instead of merging ini files you would just insert the new book data into the current ini? These should supposedly be an installation of all new books into a new module set.

I looked at that VB script but I am afraid it is a little beyond me.

Daniel
Darwin
Posts: 57
Joined: Tue Feb 02, 2010 10:57 pm

Re: Custom install using Visual Studio Installer?

Post by Darwin »

We are almost talking about the same thing.

When using a merge method, you would simply remove all parts of the config.ini file that didn't have to do with your customizations - so you are essentially "inserting" and/or "updating" - the mechanism for updates just happens to be a file merge.

I should clarify that by merge I don't mean a "concatenation", but an update of any INI parameter that is provided in the partial INI.

The big difference is that by using a merge to do an insert, you simply hack out all the parts that you don't want to edit and include it in a TWZIP file and Module Installer.vbs handles the partial INI file merge for you. Otherwise you have to write some code of some type and update it and recompile it whenever you have changes to the INI (and if it is setup tool the user is prompted for an must provide admin rights).

So by reducing inserts to a merge of a partial ini with the current ini, we make the process of providing updates usable with minimal technical skill. This is in contrast to: a) high technical skill, b) with special tools, c) in a specific language or tool framework (like NSIS, Wise, Visual Studio, MSI, etc.).
zcudaniel
Posts: 19
Joined: Thu Dec 23, 2010 12:41 am
Location: Clearwater, FL USA
Contact:

Re: Custom install using Visual Studio Installer?

Post by zcudaniel »

That sounds like the way to go then. I guess we just need to wait until the programmer finds the bug in his script?
Darwin
Posts: 57
Joined: Tue Feb 02, 2010 10:57 pm

Re: Custom install using Visual Studio Installer?

Post by Darwin »

Post Deleted.
Post Reply