Archive: Big Problem - installer runs only correct if i run it TWICE !!!


Big Problem - installer runs only correct if i run it TWICE !!!
Hello all,

I got a big problem with an Installer for a special software.

It only works correct if the same installer ist executed TWICE, without changing anything.

I try to describe the situation. On remark before: The software, i am writing an installer for, is OLD, and very complex. We can't change anything, we can only automated the written install process, that is now written on a paper and needs some hours if done by hand.

Situation:
The installer first unzips a big zip-file, containing the whole system, using Nsisz::Extract.

Then installer creats a database by using 4 existing exe-Files, that have several parameters. This exe-Files consists of encapsuleted sql-code, using a C++ Sql library. This is not the problem. Database is well created by these command, either by a batch file, or by the installer-programm.

Then the created Database (on MSSQL-DB-Server) is filled with same base-date, using another existing exe-command, like above. It can handle several parameters, and the path and name of some text-files that contains the base-info.

This is the command, with some parameters and Data Text-file.
setsu.exe $2 -s StandardUser -m GKN-2 -d operational -f StandardUser_operational_GKN-2_UDMA.sdo

-f is the text-file name

(by the way: I must use this command, can't write it directly per sql-statements. This is the project-demand)

And now, THIS IS THE PROBLEM ! When i run the NSIS installer - that I wrote - the first time, the Database is correct generated, BUT the base-info, coming out of the text-files isn't putted in. The tables are empty !

If I run the UNCHANGED installer another time, the
info out of the text-files is correctly putted in the Database ! It doesn't matter if I overwrite the database, or not !

This is a very strange behaviour. Unfortunately it is very difficult to get a log from the exe-files, because Execwait doesn't show the shells.

During the installationprocess itt is the first time, I try to read info from files, all commands before are only parameters, pathes and registry keys.

My question is: Could it be, that the unzipped textfiles, are in the first run of the installer "locked", so that they can't be read. Or that they are not completly there, even they are visible either in windows explorer, or dir-command ?

Does anyone have an idea, why the textfile data is only written in the database if the installer is run TWICE ?

I would be happy for ANY Tipps...


no idea, specifically, but you could use ExecDos instead of ExecWait:
http://nsis.sourceforge.net/ExecDos_plug-in
That will allow you to output the program's stdout (what it would print to screen) to the install detail window, to a file, to the stack for reading, etc.

The program's output may give a clue, at least.


ExitCode -128 in first run
and 2 in second run !

Strange !

What means -128 ?


well I meant the output it would normally print to screen (i.e. when you run it in DOS); ExecDos can redirect that to a file. That should have more details.

What you're referring to are exit codes, and you'd have to check the documentation for / developers of 'setsu.exe' to see what the exit code values mean.


Hmmm....
I think, the exit-code is from ExecDos...
Because if I exec a file, which is not there, or make some other things, it occurs to the same exit-codes.

So they must come from ExecDos, needn't they ?