Archive: copy text content to text file


copy text content to text file
hi
how to copy a piece of code to text file
for example create text.txt with Following content
-----------text.txt----------------
[InstallShield Silent]
Version=v7.00
File=Log File
[ResponseResult]
ResultCode=0
[Application]
Name=Realtek High Definition Audio Driver
Version=2.89
Company=Realtek Semiconductor Corp.
Lang=0009
-------------------------------


Use the ini instructions. http://nsis.sourceforge.net/Docs/Chapter4.html#4.9.2


i want copy nsi script to text file
example:
-----------------------------------------

;Basic Example Script
;Written by amir taji

;--------------------------------
;Include Modern UI

!include "MUI.nsh"

;--------------------------------
;General

;Name and file
Name "test"
OutFile "empety.exe"

;Default installation folder
InstallDir "$PROGRAMFILES\Ghasr-Computer"

;Get installation folder from registry if available
InstallDirRegKey HKCU "Software\Ghasr-Computer" ""

BrandingText "Powered By Amir Taji (Ghasr Computer)"


;Interface Settings

!define MUI_ABORTWARNING

!define /utcdate NOW "%H-%M-%S %d %b, %Y"
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP ".\banner.bmp" ; optional


SetDateSave on
;SilentInstall silent
AllowSkipFiles on
SetOverwrite on
;ShowInstDetails nevershow
XPStyle on
;--------------------------------
;Pages

!insertmacro MUI_PAGE_COMPONENTS

!insertmacro MUI_PAGE_INSTFILES

!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES

;--------------------------------
;Languages

; !insertmacro MUI_LANGUAGE "English"

;--------------------------------

Function verscan

ReadRegStr $R0 HKLM "SOFTWARE\ESET\ESET Security\CurrentVersion\Info" "ScannerVersion"
ReadRegStr $R1 HKLM "SOFTWARE\Eset\ESET Security\CurrentVersion\Info" "InstallDir" /* C:\Program Files\ESET\ESET Smart Security\ */
ReadRegStr $R2 HKLM "SOFTWARE\Eset\ESET Security\CurrentVersion\Info" "AppDataDir" /* C:\Documents and Settings\All Users\Application Data\ESET\ESET Smart Security\ */


FunctionEnd







;ICON "nod32.ico"



;--------------------------------
;Installer Sections

Section "RENAME"

WriteINIStr .\something.ini inisec something 123

SectionEnd
;--------------------------------
Section "inisec"
WriteRegExpandStr HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" "RegisteredOwner" "Gsoft Group"
WriteRegExpandStr HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" "RegisteredOrganization" "www.IRWIT.com"
WriteRegExpandStr HKCU "Software\Microsoft\Internet Explorer\Main" "Start Page" "http://www.IRWIT.com"
SectionEnd


Function .onSelChange

!insertmacro StartRadioButtons $1
!insertmacro RadioButton ${nod}
!insertmacro RadioButton ${update}

!insertmacro EndRadioButtons

FunctionEnd
;--------------------------------
;Descriptions

;Language strings

LangString DESC_nod ${LANG_ENGLISH} "1-install Eset Nod32 Antivirus $\n$\n 2-Update Eset Nod32 Antivirus $\n$\n 3-Crack For Online Update"
LangString DESC_update ${LANG_ENGLISH} "1-Update Just Eset Nod32 Antivirus $\n$\n 2-Crack For Online Update"




!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN

!insertmacro MUI_DESCRIPTION_TEXT ${nod} $(DESC_nod)
!insertmacro MUI_DESCRIPTION_TEXT ${update} $(DESC_update)




!insertmacro MUI_FUNCTION_DESCRIPTION_END

;--------------------------------
;Uninstaller Section

Section "Uninstall"

;ADD YOUR OWN FILES HERE...

Delete "$INSTDIR\*.*"

RMDir "$INSTDIR"

DeleteRegKey /ifempty HKCU "Software\Modern UI Test"

SectionEnd

----------------------------------------


please help me!


Using WriteINIStr: http://nsis.sourceforge.net/Docs/Chapter4.html#4.9.2.13 as suggested MSG is the best way to do it.

For more cool solution use FileWrite: http://nsis.sourceforge.net/Docs//Chapter4.html#4.9.5.8


hi
can You help me about this error؟
http://up.iranblog.com/images/atuwd7i8gpy83cuobhzr.jpg
--------------------------------
ClearErrors
FileOpen $0 ".\test.nsi" w
IfErrors done

FileWrite $0 "Exec '"msiexec" /fe "$R2\Installer\$1" /quiet '"
-------------------------------
i want copy
Exec '"msiexec" /fe "$R2\Installer\$1" /quiet '
in test.nsi

What character will be replaced with double quotes (")


please help me!


You cannot use " quotes inside a string quoted by the same " quotes. Use either a ` quote around the whole thing, or use $\" to escape the quote character.