Innosetup - help request for writing TXT

All non-XnView related: softwares, formats, imaging, photography...

Moderators: XnTriq, xnview

Post Reply
User avatar
Peter2
XnThusiast
Posts: 1112
Joined: Thu Nov 24, 2005 3:07 pm
Location: CH

Innosetup - help request for writing TXT

Post by Peter2 » Wed Jan 20, 2010 5:33 pm

Hello

I try to prepare my first Innosetup-package and want (if it is simply possible) to write text to a TXT-file.

I asked for help in the Innosetup-newsgroup, but the result was a little bit confusing; maybe I can find some helping lines here
http://news.jrsoftware.org/read/article ... etup#85420

I want:
- every SETUP should write a small text-file

I coded:

Code: Select all

[Run]
Filename: cmd.exe; Parameters: /c echo hello world>>d:\messages.txt; Flags: runhidden
Filename: cmd.exe; Parameters: /c time/t>>d:\messages.txt; Flags: runhidden
After setup I got this file as result (d:\messages.txt):

Code: Select all

hello world
15:52
It seem to work, but the newsgroup said it is wrong and dangerous. And I don't why and know what to do ...

Who can help?

Regards

Peter
XnView 2.48 German, Win 7 x64 Prof. / Win 10

User avatar
helmut
Posts: 8153
Joined: Sun Oct 12, 2003 6:47 pm
Location: Frankfurt, Germany

Re: Innosetup - help request for writing TXT

Post by helmut » Mon Feb 01, 2010 10:41 pm

Hello Peter2!

I've just read the topic in the Innosetup forum. The help given there is a bit "short". But rather than you asking for help in the XnView forum you should continue in the Innosetup forum.

From what I get out of the discussion, using "cmd.exe" for writing a text file is possible, but not really the way to go. Your solution might work on your Windows version, but might cause problems on other Windows version with a different command line interpreter. There might be security issues, too. Last not least Pascal scripting is not too hard to learn. These are probably the reasons why the Innosetup people do not want to support your solution in any way.

Ask the Innosetup people there for a Pascal example that writes a text file (that should be a piece of cake for them) and for the requisites (Compiler, ...) needed. Then, you can modify the example, compile and run it. It's a bit harder way to go, but I think it's worth the effort, because you will have a reliable setup program, then.

Hope this helps, Helmut

User avatar
Peter2
XnThusiast
Posts: 1112
Joined: Thu Nov 24, 2005 3:07 pm
Location: CH

Re: Innosetup - help request for writing TXT

Post by Peter2 » Mon Feb 01, 2010 10:54 pm

Good evening Helmut

thanks for your reply. At the moment, I stopped my idea with the txt-file, because I made "only" a company-internal re-packaging of an external software and the txt would be only an additional, but not absolutely necessary feature.

Regards

Peter
XnView 2.48 German, Win 7 x64 Prof. / Win 10

Post Reply