Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FoxPro 9.0 - Build .exe 1

Status
Not open for further replies.

MajklPan

Programmer
Jan 11, 2023
74
0
0
CZ
Hi,
I don't know how to correctly create the installation file of the project, because if I create only an exe file (see picture) and replace it in the project, it no longer works correctly.
1_neotor.png


How should I create an installation file so that the user can just install the program and it works?

I tried this procedure and it doesn't work, I just keep getting a pjx file (picture 2)
2_jjm6gv.png

In FoxPro, you can create an installation file using the "Setup Wizard" or "Save As" tool.

1.Launch the FoxPro program.
2.From the main menu, select "File" and then "Save As".
3.Choose "Setup" as the file type.
4.Enter a name for the installation file and the location where you want to save it.
5.Click on the "Save" button and then the "Setup Wizard" window will appear or the saving process will begin.
In the Setup Wizard, click on the "Next" button and select the files that you want to include in the installation file.
6.Click on the "Next" button and set up the installation options, such as the target folder or installation preferences.
7.Click on the "Next" button and create informational pages that will be displayed during the installation.
8. Click on the "Finish" button to create the installation file.
Note: It's important that you have write access to the location where you want to save the installation file.

This guide explains how to create an installation file in FoxPro that includes all necessary files, settings, and instructions for installation.

thank you for the advice
 
Which line is 168? Sorry, I'm not really happy with having to ask everything that would be natural for you to provide. I'm not at your commputer. Please read what you're posting and think if someone not at your computer can make all of it that he needs to make of it.

I also don't speak your language, so could you translate the error message?

If konzind is missing, then likely because it would have been created by the RESTORE of gpt_memo.mem earlier in the code and the reason of that error therefore is a follow-up error of still the same problem, that pathing isn't working. You must have mangled something at some point. You only get this to work correctly again, if you go through the line that RESTOREs the mem file.

I also have the suspicion you lost some information from the mem file, likely if someone edited that file. Then you lost information you can't restore and have to find out from a healthy mem file what should be in there.

The code section you give would create konzInd, even if it wasn't declared before the line koncInd=AT(".",aFileVer[4],1), as an assignment creates a variable.

This depends on nRetVal = GetFileVersion((cCestaProgramu)+"\progs\gpt_tisk_sestav.exe",@aFileVer), which you should look into, either a function, procedure or a GetFileVersion.prg that takes these parameters and fills the sFileVer array. This line once more depends on cCestaProgramu being the parent directory of the progs folder. And if you don't have that, it's still the root of your problem. Any error you have related to not found files is just a follow up problem of cCestaProgramu not pointing at the right directory or files not at the expected location. The setup of your old version could be your referencee of that, unless you or anybody reorganized something. You need to sit down and figure out where things belong so they find each other and work together.

In regard of the progs folder, I did never said that the whole progs folder must be deleted from the installation as all programs are inside the EXE, I just stated that this would be normal. Because you only need external PRG files, if you call them but don't include them in the EXE. The expression (cCestaProgramu)+"\progs\gpt_tisk_sestav.exe" clearly expects the EXE inside the progs folder, so it is necessary for that reason. But you likely don't need PRGs in there, that are built into the EXE. Even if your developer did this to enable editing the PRGs, notice anything that is included in an EXE is taken from within the EXE, so changes made to prg files outside of the EXE won't have an effect.

The whole project cries for reorganization of everything, but your first solution should be to figure out how things really should be. Did I already say it could be important that you build the EXE and let the build create it in the project folder, but you then copy or move the resulting exe into the progs folder instead of specifing that destinaton during the build. Even that can make a difference.

The example I gave about the difference of compiling two EXEs from the same code, just once with the default folder during build being the project home directory and once the prog subfolder should make it clear I'm serious about this. I think we have too many problems with English translation, so essential things don't get over to you. Bt it should by now be clear that you have to be very precise not only in the code alone, but also in how you're building exactly. If you open a project you usually C into the project home directory. If you test your code in the IDE and it works, your current folder might have changed and then the build doesn't work the same as if you open up VFP and the project and compile while the project homedir is the current folder. All this can play a role, even if nothing changes in the code.


Chriss
 
One more thing to show with my buildproblems project: If you delete the project folder and restart from scratch, but this tie remove the RECOMPILE from the second BUILD EXE command, then the A and B exes will output the same value in their messagebox.

That corresponds to the "Recompile all" option of the build dialog. so that also can make a change. A helathy project should build correctly with recompile all, though.

Chriss
 
Heres a simple how to get to line 168 of your program.

1. open it.
2. right click anywhere to get this context menu:
3. pick Go To Line and type in the line number 168 you got from the error message.
gotoline1_glzj9l.png


This menu item is also available in the Edit menu:
gotoline2_d1j52b.png


And there's a third option to know which line is line 168 of your program, if you turn on displaying your text cursor position in the properties of the VFP code editor:
editorposition_qnkglf.png


That will then be displayed in the status bar of the VFP main screen, like that:
status_bar_position_jlsk46.png


I can't help you, nobody can help you, if you're that unable to help yourself, that you can only vaguely guess the location of the error. Common, you have been given the exact line numberr from the error handling established. Is it really that hard for you? That was a lot of words for how speechless you make me. Sorry, but if you're not able to provide the code at the exact position you now know, then at least ask how the hell you will get to line no 168 of a program. I don't even mind strong language, if you think how outdated this IDE is in comparison to Visual Studio or other IDS. But don't look out for code related to the variable name and guess there might be line 168 somewhere in there.

You have exact data, use it!

PS: one more thing, before you now get snappy and provide only code of line number 168. First of all, it would be fine, if you think about what could have failed in that line for yourself, then it also helps to show a feew lines before that line. It's okay to provide a code snipped as you did, but we can't guess what is line number 168 in that snippet. If you continue that way, I just have to remove myself from such a thread.

Chriss
 
Line 168 is here:
Code:
cisVer3=VAL(SUBSTR(aFileVer[4],koncInd+1))
Error Message: Variable KONCID not found.

Unfortunately, I couldn't find GetFileVersion.prg anywhere. Anyway, I had version 1.0.2 set my predecessor had 1.0.1 set anyway when I rolled it back and rebuilt the exe file nothing changed and the error was still there. I did one such thing, I left gpt_tisk_sestav.exe in the main file and copied it once more into the Progs folder so it was there twice and the error went away.

So to confirm that gpt_tisk_sestav.exe was verifying the version in the Progs folder, I simply edited the path, deleted the Progs folder path and left the main program path. No error. The exe file also works in the IDE.

I know where they can be accessed, where the line code is, but thank you for the detailed instructions.
Thank you also for your patience and time :)

Could you still help me create the installation file in the InstallShield Express program?

thank you
 
I have a problem building the setup.exe, I managed to do it twice, but it was without the application icon on the desktop.
I tried a lot of options, manually add a new icon to Applications Shortcuts>Use alternate shortuct Icon > Browse...
Unfortunately, that doesn't work either. He tried to change the icon in FoxPro as well, and he also writes a constant error. Or I generated a new Ico and also nothing. Do you know where the problem could be?
Error:
Code:
ISEXP : error -6270: The record gpt_tisk_sestav.exe_E54A6EDEEE234E0DB93F85BE494C49C3_6.exe in the Icon table exceeds the limit of 57 characters.  As a result, the build will be unable to persist the database.
ISEXP : error -3204: Cannot extract icon with index 0 from file C:\Users\svrcinam\Desktop\GPT_tisk_sestav_Z_\gpt_tisk_sestav.exe
555_hllg99.png
 
First, fine you solved your pathing issue.

The line 168 code akes use of a name koncInd. The queston is, why this wasn't a variable at that point. And why it now is, when you made your changes.
If I would be at that position knowing that line and koncInd missing. The natural step of analysis then is to look for a declaration and setting of koncInd before that point in code. Not only in lines above it, but in terms of what code executes before that line. And that would be a debugging session very likely, but also you can then position in that erratic line, search for koncInd in backwards direction from there.

If there would be no LOCAL koncInd, no PUBLIC koncInd and no assignment koncInd=..., then this variable has to come from somewhere else. And that would likely be a RESTORE, which we already know is somewhere in your code.

If that's the case, then it's really a bad architecture in itself, using mem files on one side, but also making it optional by code the RESTORE runs, because looking at what you posted at 26 Jan 23 06:16 the RESTORE is only done IF the mem file is found. That avoids an error of RESTORE trying to restore form a non existing file. But avoiding that error lead to a much more serious problem later, as you experienced.

Such a thing belongs in documentation, which variables are stored and thus come from a RESTORE is important to know it's actually not optional to have the mem file restored. So there should be an ELSE branch using a messagebox telling the application doesn't find its mem file and therefore can't continue.

You see why I already uttered about using mem files. Their binary structure does not easily tell you what is in them, so even with a suspicion about them, you will need to dig deep to find out what's in there and why and what's necessary or what's perhaps wrong in there.

So far, so good.

Now, regarding your installshiled express issues: The version of it is very outdated, and I would rather use some other setup utility, but more important: This is a completely independent and new issue, so please start a new thread for that. In your own interest, because I bet many people here have already removed themselves from this long thread and won't realize your new question.

Chriss
 
Unimportant, but VFP has AGETFILEVERSION and it seems your former programmer wrapped that into a user defined function. And the 4tth element of the array created and populated with values is the file version.

So did you do changes without changing the version before? There seems to be a functionality detecting version changes in there and your change from 1.0.1 to 1.0.2 triggered a code section usually not used. If that's the case, now you know what single change you made, that you never made before.

It could be important to rather understand this mechanism and support and fix it, instead of going to a setup.exe. One thing that's making setups less favorable is, that they need to be done administratively. But if that's fine with you, you can go that route, of course. I know larger corporations use softwaremanagement assigning software to clients, which is based on MSI setups, usually.

The only thing you profit from using installshields in this outdated version is, that it can work with the merge modules that are installed with VFP that cover C++ runtime, VFP runtimes, xml3, xml4 and the different language resource DLLs like VFP9rcsy.msm for Czech and many more.

The help has a walkthrough for using installshield, by the way, which also describes in which cases to add which merge modules. And you likely don't come to an error with Installshield, if you create a setp following that walkthrough description.

Chriss
 
I understand, using .mem is quite complicated, but the way you explained it to me, I understood and treated it.
I consider it as resolved, since no error is displayed in either the IDE or the EXE, so I consider it a working program [smile]
As a company, we have purchased 3 different versions from VF, where the InstallShield part is on the disk.
So I'll create a new thread to install.

Thanks again for your advice and especially your patience with me and your time.[rednose] Have a nice day
 
Hi, I got very professional help here last time to solve a problem.
However, only today I found out that certain things do not work for me regarding "InfoUsek", the program displays the following message, do you know where the problem could be?

Most likely there will be a problem in granting rights in the output, but I have no idea how to fix this error :(
If anyone knows it would be very helpful.
Thank you again for your help

ERORR_uzngzh.png
 
A error message it's very clean.

Is a table GPTINFO include in project or not?

mJindrova
 
It's really bad forum use to come back to a 3 months old thread and add to it, even if it was your only thread so far.
Please make a new problem a new thread.

And then do yourself a favor and not only post the error message, but the code of that button click, we are not at our computer and don't have your code at hand.

Chriss
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top