What I want to do: Within a section during instfiles I want to use the System Plugin to call a "Save File As..." Dialog. After much research I've found that the WinAPI comdlg32.dll function, GetSaveFileName, does just that. The tricky part is the setup for the call 🙁 . Here's what I have so far... Any help would be nice 😁
SAM
Sources:
SetPluginUnload alwaysoff
; Setup a structure for allowed file types
; Build Struc #1
System::Call '*(t "Text Files (*.txt), *.txt;", t "All Files (*.*), *.*;") *i .r0'
; Setup the OPENFILENAME structure and store it into $2 (returns path and filename into structure $1)
; Build Struc #2
System::Call '*(i 23, t $HWNDPARENT, v, *i r0, i 0, i 0, i 0, *i r1, i 260, v, v, i 0, t "Open File", i 0x80000, 0, 0, "*", v, v, v, v, v, v, v) *i .r2'
; Open Save file dialog and return a bool into $3
System::Call 'comdlg32::GetSaveFileName(*i r2)'
Pop $3
; Now get the path and file name and put them together
System::Call '*$1( t r4, t r5)'
IntOp $6 $4 & $5
; MessageBox to the user the path/file that they chose
MessageBox MB_OK "Save File As Info...$\n\
Path: $4$\n\
FileName: $5$\n\
Whole String: $6"
; Unload the plugin from memory
SetPluginUnload manual
System::Free $0
System::Free $1
System::Free $2
System::Free 0