Old 30th October 2007, 20:19   #1
johanfo
Junior Member
 
Join Date: Oct 2007
Posts: 1
Overwrite confirmation

Hi,
I'm writing a really simple installer. Basically, its purpose is to copy a few files to different locations on the drive. I could of course do this by batch scripting, but I want it to look nice.

One thing I haven't figured out is, how do I make the installer prompt the user to "OK" an overwrite. The way I see it, you have either a overwrite mode or a no-overwritemode, but both are without user interaction.

Any help or hits here would be appreciated.

JF
johanfo is offline   Reply With Quote
Old 30th October 2007, 21:24   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Either check if the file exists with IfFileExists or ${If} ${FileExists} or wrap it with SetOverwrite try and IfErrors. In both cases, you can put the code in a macro for simpler usage.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 2nd November 2007, 13:49   #3
Fightin_Foo
Junior Member
 
Join Date: Nov 2007
Location: Ohio
Posts: 49
Send a message via AIM to Fightin_Foo
How about using a message box? Turn the overwriting on and then make the box pop up asking if the user wants to overwrite the files. Then if the user says yes overwrite, and if not skip that section.

Something kinda like this:

MessageBox MB_YESNO|MB_ICONQUESTION "Do you want to overwrite the files" IDYES overwrite IDNO skipoverwrite

overwrite:
; overwrite all the files
skipoverwrite
; proceed with install without overwriting files

Hope it helps

From there to here,
from here to there,
funny things
are everywhere.

Dr. Seuss
"One Fish Two Fish Red Fish Blue Fish"
Fightin_Foo is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump