You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While adding a script to run in the process of installation, I see the file I'm writing into being deleted or removed from the installation directory. Why?
my script create new file and write inside user name/password:
my installer.nsh file:
!include nsDialogs.nsh
!include LogicLib.nsh
XPStyle on
Var Dialog
Var UserLabel
Var UserText
Var UserState
Var PassLabel
Var PassText
Var PassState
Page custom nsDialogsPage nsDialogsPageLeave
Function nsDialogsPage
nsDialogs::Create 1018
Pop $Dialog
${If} $Dialog == error
Abort
${EndIf}
${NSD_CreateLabel} 0 0 100% 12u "Your Username:"
Pop $UserLabel
${NSD_CreateText} 0 13u 100% 12u $UserState
Pop $UserText
${NSD_CreateLabel} 0 39u 100% 12u "Your Password:"
Pop $PassLabel
${NSD_CreatePassword} 0 52u 100% 12u $PassState
Pop $PassText
nsDialogs::Show
FunctionEnd
Function nsDialogsPageLeave
${NSD_GetText} $UserText $UserState
${NSD_GetText} $PassText $PassState
${If} $UserState == ""
MessageBox MB_OK "Username is missing."
Abort
${EndIf}
${If} $PassState == ""
MessageBox MB_OK "Password is missing."
Abort
${EndIf}
StrCpy $1 $UserState
StrCpy $2 $PassState
FunctionEnd
Section
SetOutPath "$INSTDIR\myfolder"
FileOpen $9 $INSTDIR\myfolder\credentials.txt w
FileWrite $9 "$1 $2"
FileClose $9
SectionEnd
While running the setup.exe file I can see it creates "myfolder" and also creates the "credentials.txt" file and update it, but when the process ends - the folder stays empty. The file was removed. Why? What I'm missing here?
Is there a better way to update some file in the setup process and use that info inside the application? the user name and pass for example are something needed to be used inside the application.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
While adding a script to run in the process of installation, I see the file I'm writing into being deleted or removed from the installation directory. Why?
my vue.config.js file:
my script create new file and write inside user name/password:
While running the setup.exe file I can see it creates "myfolder" and also creates the "credentials.txt" file and update it, but when the process ends - the folder stays empty. The file was removed. Why? What I'm missing here?
Is there a better way to update some file in the setup process and use that info inside the application? the user name and pass for example are something needed to be used inside the application.
Beta Was this translation helpful? Give feedback.
All reactions