MAKEMSI quickly and reliably creates MSI files in a non-programmatic way
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
[Bottom][Contents][Prev]: Logo on Dialogs[Next]: Progress Bar - More Detail
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
\->Tips and Tricks->User Interface Tips->MSI Dialog Editor

Note that now MAKEMSI has a "Dialog command that can quite simply take care of most dialog requirements the need for a GUI is reduced.

MSI Dialog Editor - News Group Posting (27 June 2003)
Hi,

I have created a proof of concept for a poor man's dialog
editor which could do the basics well (copy/clone dialogs
and controls and alter them visually to remove the current
"ORCA" table edit/preview/edit loops which
ORCA MAKES VERY PAINFUL due to its complete lack of help,
such as remembering "anything" and lack of hot keys.

The VBS code is at:

http://dennisbareis.com/zips_fw/dlgedit.zip

A good model I think is your monitors screen controls, you choose
what you are modifying then choose bigger/smaller etc, having a
bigger keyboard you could have a lot of things going at once...
A GUI for choosing dialogs and controls etc.
Why not even make part of Orca...

Of course if ORCA had a preview mode where you could continue to
edit the tables and it refreshed on table changes that would
also be good...

I would like to spend time on this but all my current time
is taken up working on my MAKEMSI and related tools.

Now it would be nice if any tool built would be freeware and
support invocation via the command line so that I could build
a process to clone an msi into "before" and "after" images
and after all changes have been made to the "after", use my
"MsiDiff" tool to capture the differences (in human AND
machine readable format).

My email is dbareis@gmail.HateSPAM.com

Bye,
Dennis

The Code for the MSI Dialog Editor

const ForReading   = 1
const msiOpenDatabaseModeDirect       = 2
set oFs        = CreateObject("Scripting.FileSystemObject")
set oInstaller = CreateObject("WindowsInstaller.Installer")

wscript.echo "Note that this sample has been hard coded for ""UISAMPLE.MSI"" in the current directory and hardcodes the dialog/control."

set oMsi      = oInstaller.OpenDatabase("out\UiSample.msi", 1)
set oPreview  = oMsi.EnableUIpreview()


'set oView = oMSI.OpenView("SELECT * FROM `Control` where `Dialog_` = 'CustomizeDlg' and `Control` = 'Tree'")
set oView = oMSI.OpenView("SELECT * FROM `Control` where `Dialog_` = 'CustomizeDlg' and `Control` = 'Box'")
oView.Execute
set oRec = oView.Fetch

P = "This is a proof of concept only. I am too busy with MAKEMSI to do much more... "
P = P & "I see it working much like the controls of a good monitor to adjust image "
P = P & "height, width etc. "
P = P & "I see the dialog, control being selected in a similar manner, even better "
P = P & "would be a decent app with a menu, hot keys etc. "
P = P & "New controls would be created (possibly cloned) and attributes adjusted."
P = P & vbCRLF
P = P & vbCRLF
P = P & "This approach is not perfect but it takes all the difficulty out of "
P = P & "the task - so what do you think?"
P = P & vbCRLF
P = P & vbCRLF
P = P & "I would love to see someone create a freeware Dialog Editor. "
P = P & "It would be nice if it could keep a before and make an after MSI and use "
P = P & "my MSIDIFF program to capture the differences."
P = P & vbCRLF
P = P & vbCRLF
P = P & "Type ""x"" to exit or commands like ""Y=90"" or ""H=22"", this is not the best way "
P = P & "just the easiest for the proof of concept."
P = P & vbCRLF
P = P & vbCRLF
P = P & "Dialog_"    & chr(9) & "= " & oRec.StringData(1) & vbCRLF
P = P & "Control"    & chr(9) & "= " & oRec.StringData(2) & vbCRLF
P = P & vbCRLF
P = P & "ORIGINAL VALUES" & vbCRLF
P = P & "===============" & vbCRLF
P = P & State(oRec)
P = P &  vbCRLF
P = P & "CURRENT VALUES" & vbCRLF
P = P & "==============" & vbCRLF

LastResponse = ""
do
   '--- Display the dialog (original or changed) ----------------------------
   oPreview.ViewDialog("CustomizeDlg")

   '--- Get user response ---------------------------------------------------
   Response = InputBox(P & State(oRec), "Poor Man's Dialog Editor - Dennis Bareis", LastResponse, 50, 50)
   if  ucase(Response) = "X" then exit do
   LastResponse = Response

   '--- For now only support " ? = ?" ---------------------------------------
   Cmd = split(Response, "=", 2)
   if  ubound(Cmd) = 1 then
       '--- What did the user wish to modify? -------------------------------
       What = ucase(trim(Cmd(0)))
       on error resume next                'Hack for now...
       select case What
           case "T", "TYPE"
                oRec.StringData(3) = Cmd(1)
           case "X"
                oRec.IntegerData(4) = cint(Cmd(1))
           case "Y"
                oRec.IntegerData(5) = cint(Cmd(1))
           case "W", "WIDTH"
                oRec.IntegerData(6) = cint(Cmd(1))
           case "H", "HEIGHT"
                oRec.IntegerData(7) = cint(Cmd(1))
       end select
       on error goto 0

       '--- Make the change -------------------------------------------------
       oView.Modify 2, oRec
   end if
loop
oPreview.ViewDialog ""


'--- Lets not commit the changes! -------------------------------------------
set oView     = Nothing
set oMsi      = Nothing
set oPreview  = Nothing
wscript.quit 99


'============================================================================
function State(oRecord)
'============================================================================
   State =         "Type"       & chr(9) & "= " & oRec.StringData(3) & vbCRLF
   State = State & "X"          & chr(9) & "= " & oRec.IntegerData(4) & vbCRLF
   State = State & "Y"          & chr(9) & "= " & oRec.IntegerData(5) & vbCRLF
   State = State & "Width"      & chr(9) & "= " & oRec.IntegerData(6) & vbCRLF
   State = State & "Height"     & chr(9) & "= " & oRec.IntegerData(7) & vbCRLF
end function


Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.Please email me any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Prev]: Logo on Dialogs[Next]: Progress Bar - More Detail


MAKEMSI© is (C)opyright Dennis Bareis 2003-2008 (All rights reserved).
Saturday May 28 2022 at 3:11pm
Visit MAKEMSI's Home Page
Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.