Archive: Example Tutorial not working


Example Tutorial not working
Hi,

The example tutorial named "Simply install a file" that is given under "Simple Tutorials" on this website is not working.

The scripting code for the example is the following:

# define the name of the installer
outfile "simple installer.exe"

# define the directory to install to, the desktop in this case as specified
# by the predefined $DESKTOP variable
installDir $DESKTOP

# default section
section

# define the output path for this file
setOutPath $INSTDIR

# define what to install and place it in the output path
file test.txt

sectionEnd


The accompanying text with the example says
This installer script will copy the file "test.txt" to the installation directory Create the test.txt file on the Desktop first, then compile the installer script below and then delete the test.txt file . Running the simple installer installs the test.txt file to the Desktop.
I am using NSIS 2.46 , and on compiling the above mentioned script, gets the message that "File: "test.txt" -> no files found.". This is strange as I have ensured that the file named "test.txt" indeed exists on the desktop and is not hidden. I have also checked that the $DESKTOP variable is correctly pointing to the Desktop folder on my computer. My OS is Windows 7.

Any suggestion to solve the issue would be appreciated.

Regards,
Dinesh

The file shouldn't be on your desktop, it should be in the location where your example.nsi is.


$DESKTOP is a run time constant not a compile time one. You should do some more reading.

Stu


solved: Example Tutorial not working
Hi MSG,

Thanks for your reply. Your suggestion worked, and the script is now working. :)

Dear Mod,

Thanks for your reply as well. Would you mind telling where I said that $DESKTOP is a compile time constant? Is it post pumping?

-Dinesh


No I just assumed you thought by specifying InstallDir as $DESKTOP you needed to place your build files on the desktop as well.

Stu