aj kwak
21st March 2005 09:28 UTC
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
glory_man
21st March 2005 10:05 UTC
In my installer there is a checkbox to execute the program on startup or not.
Where is this checkbox?
aj kwak
21st March 2005 10:17 UTC
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"
glory_man
21st March 2005 13:28 UTC
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.
glory_man
21st March 2005 13:43 UTC
but SetOutPath could not be used in a function...
Where are you read it?
Afrow UK
21st March 2005 17:54 UTC
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