How to convert DFM to Text?

Got a problem you cannot solve? Try here.
Post Reply
wolbrink
Posts: 76
Joined: Wed Nov 17, 2004 3:00 pm

How to convert DFM to Text?

Post by wolbrink »

Just like how IA now creates *.mia.txt files to better help developers track changes to their scripts, I'm trying to build a tool that can create *.dfm.txt files so that I can better track changes to my dialogs.

I was guessing that Delphi's Classes.ObjectBinaryToText() would be able to handle this for me. But I'm finding that's not the case. Any clues or hacks that might help me?

Thanks!
Troy
paulm
Posts: 12
Joined: Fri Jul 03, 2009 10:30 am
Location: UK
Contact:

Post by paulm »

If you have Delphi you could use the convert.exe found in the BIN folder

Command line something like...
"C:\\Program Files\\CodeGear\\RAD Studio\\5.0\\bin\\Convert.exe" c:\\temp\\welcome.dfm c:\\temp\\welcome.txt


Paul
wolbrink
Posts: 76
Joined: Wed Nov 17, 2004 3:00 pm

Post by wolbrink »

paulm wrote:"C:\\Program Files\\CodeGear\\RAD Studio\\5.0\\bin\\Convert.exe"
That worked great. Thanks, Paul.

--Troy
wolbrink
Posts: 76
Joined: Wed Nov 17, 2004 3:00 pm

Re: How to convert DFM to Text?

Post by wolbrink »

wolbrink wrote:Delphi's Classes.ObjectBinaryToText()
I just noticed it's actually: ObjectResourceToText().

I'm glad I can track my dfm changes in version control now!

--Troy
neillans
Posts: 536
Joined: Sat Nov 04, 2006 6:21 am
Location: Scottish Borders, UK

Post by neillans »

One question for you guys ....


How would you feel if InstallAware natively supported TXT DFM's and allowed saving scripts as XML files (natively) ?
Andy Neillans
wolbrink
Posts: 76
Joined: Wed Nov 17, 2004 3:00 pm

Post by wolbrink »

neillans wrote:One question for you guys ....
How would you feel if InstallAware natively supported TXT DFM's and allowed saving scripts as XML files (natively) ?
TXT DFM's would be great. One less process I must run after editing dialogs.

Saving scripts as XML files natively? While that might be better than the current binary format for the *.mia file, I still like the *.mia.txt file because it closely reflects the script editor in which I'm used to working. I can imagine the XML file wouldn't be quite as intuitive to look at as the *.mia.txt file.

--Troy
DThrasher
Posts: 5
Joined: Mon Apr 20, 2009 6:27 pm

How to convert DFM to Text?

Post by DThrasher »

I support having a serializable format for the .dfm files. It would make version control so much easier. Having a .txt or .xml representation of all InstallAware script files would be a big help.

It doesn't really matter which format is used, as long as I can compare changes using a tool like WinMerge or BeyondCompare.
Chris Miller
Posts: 66
Joined: Fri Mar 09, 2007 9:46 am
Location: Albany, NY
Contact:

Post by Chris Miller »

I would prefer the text format too. Much easier to resolve the diffs.
Chris Miller
[url=http://www.versatrans.com]Tyler Technologies[/url]
[url=http://anotherlab.rajapet.net]My blog[/url]
[url=http://www.linkedin.com/in/christophermiller]My LinkedIn profile[/url]
MikeOnline
Posts: 20
Joined: Tue Nov 25, 2008 8:54 pm
Location: N. California

Post by MikeOnline »

neillans wrote:How would you feel if InstallAware natively supported TXT DFM's and allowed saving scripts as XML files (natively) ?
Changing from a TXT export to an XML export does not necessarily address a key limitation: the current text export of MIA scripts omits parameters for several commands (e.g. CALL DLL, MESSAGEBOX, etc). So comparing two versions of an MIA script's TXT files using a diff tool may not reveal several key differences. People seem to think they can store the TXT file in their source code repository and be able to track script changes over time, but this only works to an extent.

To address this limitation, and provide other advantages, I suggest the following:

1) Have the text exports contain full parameters for each command, in an easy-to-read, one-line format. If possible, a generalized export format (e.g. a list of field values, listed sequentially after the main command name, delimited by a semicolon) would be available even for plug-in commands. A future specification for plugins would call for an optional, one-line text format, so text exports of never-before-seen plug-in commands would be more readable than if they relied on the generalized export format.

2) Save TXT exports of both Script and Dialog files upon every save (presently happens only when saving MIA files)

3) If it makes sense to do so, abandon DFM and MIA files: replace both with corresponding XML files, which the InstallAware IDE and command line builder would use instead of the old files. These would be easier to programatically inspect (or edit) than the current files. Ideally, the XML schemas and basic XSLT's (for reporting purposes) would be made publicly available. And (ideally) there would be no need for GUIDs.

4) Combine the dialog rules file (MIAF) and diaglog definition file (DFM) into a single XML file; when exporting this file to text, include the rules at the end, in their own section.

Regards,
- Michael Litwak
ALive
Posts: 109
Joined: Mon Apr 27, 2009 5:54 am
Location: Russia

Post by ALive »

Great idea, Mike!!! Especially about XML (and no *.mia at all)

I hope IA would hear you!!

I would add Unicode support! And much better Localization mechanism.

Cheers.
MikeOnline
Posts: 20
Joined: Tue Nov 25, 2008 8:54 pm
Location: N. California

Post by MikeOnline »

When I have encountered runtime errors with InstallAware installers, I have wished that I had the means to validate my InstallAware project files. It would be a great boon to be able to verify that InstallAware project files were not corrupt in any way.

If all the project files -- including .MIA, .MIAF, .DFM, .MPR and any others -- were XML files (with publicly-available detailed schemas), then validation would be a snap. The XML's would simply be validated against the corresponding schema file.

- M
Bikedude
Posts: 24
Joined: Wed Jun 10, 2009 10:02 am

Fix this ASAP please

Post by Bikedude »

MikeOnline wrote:3) If it makes sense to do so, abandon DFM and MIA files: replace both with corresponding XML files, which the InstallAware IDE and command line builder would use instead of the old files. These would be easier to programatically inspect (or edit) than the current files.
...but a .dfm file (as text) is really easy to read and understand for humans.

And as I recall from my Delphi days, it is not too hard to stream in a .dfm file either so you can deal with it programmatically. (XML? Easy to programatically inspect..? Really? Are we discussing about the same messed-up standard?)

But anyway: I was very surprised and disappointed when I realized IA's .dfm files were binary. That is so... 1995. Delphi fixed that in D2 as I recall. I've been very careful saving all my .dfms as text ever since. (for extremely obvious reasons!)
Tommy
Posts: 27
Joined: Wed Oct 23, 2013 5:36 am

Re: How to convert DFM to Text?

Post by Tommy »

Hello,

Among many different project files just the DFM file is binary, which makes more difficult to work with revisions, as former posts claim.

Is there any progress or plan on the roadmap to eliminate this obstacle and render all project related files to a text file ?

Regards,
Tommy
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: How to convert DFM to Text?

Post by FrancescoT »

Unfortunaly, this is not currently in our plans.

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Post Reply