Save File dialog
Hi,
I have created a custom installer. On the installer main page, i have a save button. On click of this button. I want to open a Save File dialog, that will save the licence.rtf file.
how to do this.
Thanx.
Archive: Save File dialog
Save File dialog
Hi,
I have created a custom installer. On the installer main page, i have a save button. On click of this button. I want to open a Save File dialog, that will save the licence.rtf file.
how to do this.
Thanx.
if you are using nsDialogs, just add an ${NSD_OnClick} event to that button, and in the function called by that event, call the nsDialogs::SelectFileDialog function specifying the mode as 'save'.
Thanx for the reply. I have file $LICENCE. So when I am doing
nsDialogs::SelectFileDialog /NOUNLOAD save $LICENSE "*.txt"
it is not saving it. Am i doing something wrong?
What exactly i want is I have displayed License in the nsis installer screen. I have a save button on the installer, so when the user clicks on save button, it should save the license on the user system.
I tried this way
nsDialogs::SelectFileDialog /NOUNLOAD "save" $PLUGINSDIR\license.rtf "*.txt"
It is opening save file dialog with my file name and save as type "*.txt". But when I am clicking save, it is not actually saving it on the system.
I tried this way
nsDialogs::SelectFileDialog /NOUNLOAD "save" $PLUGINSDIR\license.rtf "*.txt"
It is opening save file dialog with my file name and save as type "*.txt". But when I am clicking save, it is not actually saving it on the system.
any recent version of nsDialogs doesn't require /NOUNLOAD - not sure if it ever did :)
You may also wish to put quotation marks around your $license if that is the variable being used for the default location on the user's computer to save the file to.
!include "nsDialogs.nsh"
outfile "$%temp%\test.exe"
Section
nsDialogs::SelectFileDialog save "$DOCUMENTS\hello_world.txt" "*.txt"
Pop $0
MessageBox MB_OK "Save location: [$0]"
SectionEnd
Originally posted by axysharmaYeah, it doesn't work that way - it simply returns the path\filename that the user chose in the dialog on the stack.
It is opening save file dialog with my file name and save as type "*.txt". But when I am clicking save, it is not actually saving it on the system.
!include "nsDialogs.nsh"
outfile "$%temp%\test.exe"
Section
nsDialogs::SelectFileDialog save "$DOCUMENTS\hello_world.txt" "*.txt"
Pop $0
MessageBox MB_OK "Save location: [$0]"
CopyFiles /SILENT "$PLUGINSDIR\hello_world.txt" "$0"
SectionENd
Thanx..it is working that way. But if the file is already at the location where I am trying to save, it overwrites it without prompting any message. is there any way we can handle it. i mean if file is already there, then it should prompt message to overwrite it.
Originally posted by axysharmasure - you'd use something like:
Thanx..it is working that way. But if the file is already at the location where I am trying to save, it overwrites it without prompting any message. is there any way we can handle it. i mean if file is already there, then it should prompt message to overwrite it.
!include "nsDialogs.nsh"
outfile "$%temp%\test.exe"
Section
_getSavePath:
nsDialogs::SelectFileDialog save "$DOCUMENTS\hello_world.txt" "*.txt"
Pop $0
StrCmp "$0" "" _skip
MessageBox MB_OK "Save location: [$0]"
IfFileExists "$0" 0 _copyFile
MessageBox MB_YESNO "The file '$0' already exists. Do you wish to overwrite?" /SD IDNO IDNO _getSavePath
_copyFile:
CopyFiles /SILENT "$PLUGINSDIR\hello_world.txt" "$0"
_skip:
SectionEnd