Archive: Execution Time/Compile Time question


Execution Time/Compile Time question
Hi,

I've got a new problem to solve. In the file I have to install, there is one I need to get paramaters to configure shortcuts, services and to modify other files. The problem is that it doesn't compile because the file isn't already here, he will be here only at execution.

Is it a way to get around that ?

Thx for your help.

Geo


It sounds to me like you have a File command that refers to a file that doesn't exist on your system. You should only use the File command when you have an actual file to be in the installer. If it already exists or your installer generates it during runtime, the File command is not used (there are other functions for that).

I'm a bit unsure if that's what you really mean, however. It would help if you posted your script.


Yes, I have a File command that refer to a file that doesn't already exist. The file is generated during runtime but I've no clue on wich command to use to extract data from it.

For the script, I'm not sure it will be usefull but I attach it to this post


Hello

I think you need something like this :


;Reserve Files
;Things that need to be extracted on first (keep these lines before any File command!)
;Only useful for BZIP2 compression

ReserveFile "genero.bat"

!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS

Function .onInit

!insertmacro MUI_INSTALLOPTIONS_EXTRACT "genero.bat"

FunctionEnd


And if you want read something of the genero.bat think that the file is in $PLUGINSDIR\genero.bat

Best regards


You'll want to use FileRead/FileReadByte, then. Look under 4.9.5 File Instructions in the documentation.

I've attached a (slightly modified) script for an updater I made - a small NSIS app that downloads a text file and checks the content. The text file indicates the latest version ($9) as well as the file size ($8). It compares $9 to the version number in the install script, and, if the two values are different, offers to download and install the new version.

The script won't work, as the files referenced don't exist (that's the part that has been modified), but it will compile and work if the URLs are changed to working ones.

If you need to do complicated calculations on the data, you may want to make a small program that does those calculations and outputs the needed results to a text file.


@kike_velez

I've try but I get the same error (file not found) :

File: "genero.bat" -> no files found.
Usage: File [/nonfatal] [/a] ([/r] [/x filespec [...]] filespec [...] |
/oname=outfile one_file_only)
Error in macro MUI_INSTALLOPTIONS_EXTRACT on macroline 7

The File command is only used to put a file on the end user's computer. Unless you're going to provide a default file (as a fallback), it's not used to access an existing file. Of course, if you ARE going to provide a default file, you have to make it.

If you're trying to copy an existing file, use CopyFiles instead.


Sorry geoffrey_4js i don´t understand the problem.
The problem is that genero.bat don´t exists and extract works with a file that exists.

Sorry again


Hello geoffrey_4js

I saw th scrip but i don´t see where you generate the genero.bat.

Best Regards