Archive: section problem


section problem
Hello,

I have made a shortcut in SMSTARTUP, so if my computer start the program starts auto. In my installer there is a checkbox to execute the program on startup or not.
So i had made a function startupfunc.

But, the program won't startup becasue the 'working directory' was not correct. So i have used SetOutPath, but SetOutPath could not be used in a function... so i made a Section.
Now it work fine, but the program start always when my computer starts.(because section are always called)
How can i solve my problem, i want that i can choose between startup AUTO/no AUTO startup.


Section ""
SetOutPath "$ANOTHER_DIR\Noma"
CreateShortCut "$SMSTARTUP\Noma.lnk" "$ANOTHER_DIR\Noma\Noma_prog.exe"
SectionEnd


In my installer there is a checkbox to execute the program on startup or not.
Where is this checkbox?

Originally posted by glory_man
Where is this checkbox?
!define MUI_FINISHPAGE_RUN_TEXT "automatically start up Noma with Windows"
!define MUI_FINISHPAGE_RUN_FUNCTION "myfunction"

From NSIS documentaion - about SetOutPath:

Sets the output path ($OUTDIR) and creates it (recursively if necessary), if it does not exist.
Maybe try to include
StrCpy $OUTDIR "$ANOTHER_DIR\Noma"
in function (not section) before using CreateShortCut.

but SetOutPath could not be used in a function...
Where are you read it?

SetOutPath works in Sections and Functions. It sets the current $OUTPATH and the current working directory for executing other programs (ie with Exec)
It also sets the 'Start in' path for shortcuts (CreateShortcut)

-Stu