Archive: If Statements


If Statements
Hi everybody.First I would just like to thank everyone for all there help,Now I need help with something else.

My installer installs MSDE,but what if the user already has MSDE installed,so then I created a dialog for the user to input his sa password so that I can attach the database which works great.But what about the users that dont have MSDE installed, you see if they dont have it installed then I dont want them to see the input dialog.So I need some sort of an if statement,so that if they dont have MSDE then the istaller will use the default password and not show the Input dialog.
Anyone that has some code or something please try and help me.
Thanx so much


Er sorry, is your question simply: how do I make an if statement?

2 good ways:
1) Create a variable e.g. Var MSDEInstalled
2) If they have MSDE installed, do StrCpy $MSDEInstalled "true"
3) if they do not, do StrCpy $MSDEInstaled "false"

Then when you come to decide whether they need the dialog or not, do:


StrCmp $MSDEInstalled "true" 0 noMSDE
; Show Dialog
Goto end

noMSDE:
; install MSDE


end:
; stuff that you'd do afterwards if they had it installed or not


OR use the LogicLib plugin that comes with NSIS, that has some form of if statement.

If Statements
That is basically what I want to do.
Thanx I will try that.


http://nsis.sourceforge.net/index.ph...&tx_faq_faq=25