Skip to content

Commit

Permalink
Replace the source code written in VBScript with JScript (#2098)
Browse files Browse the repository at this point in the history
  • Loading branch information
sdottaka authored Feb 19, 2024
1 parent 2202a28 commit b133ce2
Show file tree
Hide file tree
Showing 153 changed files with 5,992 additions and 5,490 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,7 @@ Testing/Data/Symlink/Dir2/ss12_diff_s12.txt
Testing/Data/Symlink/Dir2/ss12_diff_s21.txt
Testing/Data/Symlink/Dir2/ss12_same_s00.txt
Testing/Data/Symlink/Dir2/ss12_same_s11.txt
Src/MergeAppLib_i.c
Src/MergeAppLib_p.c
Src/dlldata.c
/Testing/PluginTests/result
12 changes: 6 additions & 6 deletions ALL.vs2017.sln
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Root", "Root", "{DC3B258E-4
BuildManual.cmd = BuildManual.cmd
CreateRelease.cmd = CreateRelease.cmd
DownloadDeps.cmd = DownloadDeps.cmd
ExpandEnvironmenStrings.vbs = ExpandEnvironmenStrings.vbs
ExpandEnvironmenStrings.js = ExpandEnvironmenStrings.js
LICENSE.md = LICENSE.md
README.md = README.md
runastyle.bat = runastyle.bat
Expand Down Expand Up @@ -165,9 +165,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Batch Files", "Batch Files"
Externals\winimerge\SetVersion.cmd = Externals\winimerge\SetVersion.cmd
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "VBS Scripts", "VBS Scripts", "{0AB212AD-1F11-4BAB-BAD5-8BFC4435F453}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scripts", "Scripts", "{0AB212AD-1F11-4BAB-BAD5-8BFC4435F453}"
ProjectSection(SolutionItems) = preProject
Externals\winimerge\ExpandEnvironmenStrings.vbs = Externals\winimerge\ExpandEnvironmenStrings.vbs
Externals\winimerge\ExpandEnvironmenStrings.js = Externals\winimerge\ExpandEnvironmenStrings.js
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SampleStatic", "Externals\crystaledit\Sample\SampleStatic.vcxproj", "{C347D6AE-7A2B-4ED0-97AD-2595E1C5D7DD}"
Expand Down Expand Up @@ -308,10 +308,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{4407E7D0
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scripts", "Scripts", "{88571237-56AD-421A-8F88-26983BDD8D6C}"
ProjectSection(SolutionItems) = preProject
Tools\Scripts\CheckMenuResources.vbs = Tools\Scripts\CheckMenuResources.vbs
Tools\Scripts\CheckMenuResources.js = Tools\Scripts\CheckMenuResources.js
Tools\Scripts\CheckTranslationStrings.cmd = Tools\Scripts\CheckTranslationStrings.cmd
Tools\Scripts\CheckTranslationStrings.ps1 = Tools\Scripts\CheckTranslationStrings.ps1
Tools\Scripts\CheckUnusedResources.vbs = Tools\Scripts\CheckUnusedResources.vbs
Tools\Scripts\CheckUnusedResources.js = Tools\Scripts\CheckUnusedResources.js
Tools\Scripts\README.md = Tools\Scripts\README.md
Tools\Scripts\UpdateTranslations.bat = Tools\Scripts\UpdateTranslations.bat
EndProjectSection
Expand Down Expand Up @@ -353,7 +353,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "q", "q", "{E4EF583F-653D-44
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PluginTests", "PluginTests", "{9738877F-0B01-4C37-855E-7465C5AB7B56}"
ProjectSection(SolutionItems) = preProject
Testing\PluginTests\PluginTests.vbs = Testing\PluginTests\PluginTests.vbs
Testing\PluginTests\PluginTests.js = Testing\PluginTests\PluginTests.js
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "yq", "yq", "{9914C8A9-0DEA-4922-9065-57034EE5263D}"
Expand Down
12 changes: 6 additions & 6 deletions ALL.vs2019.sln
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Root", "Root", "{DC3B258E-4
BuildManual.cmd = BuildManual.cmd
CreateRelease.cmd = CreateRelease.cmd
DownloadDeps.cmd = DownloadDeps.cmd
ExpandEnvironmenStrings.vbs = ExpandEnvironmenStrings.vbs
ExpandEnvironmenStrings.js = ExpandEnvironmenStrings.js
LICENSE.md = LICENSE.md
README.md = README.md
runastyle.bat = runastyle.bat
Expand Down Expand Up @@ -165,9 +165,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Batch Files", "Batch Files"
Externals\winimerge\SetVersion.cmd = Externals\winimerge\SetVersion.cmd
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "VBS Scripts", "VBS Scripts", "{0AB212AD-1F11-4BAB-BAD5-8BFC4435F453}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scripts", "Scripts", "{0AB212AD-1F11-4BAB-BAD5-8BFC4435F453}"
ProjectSection(SolutionItems) = preProject
Externals\winimerge\ExpandEnvironmenStrings.vbs = Externals\winimerge\ExpandEnvironmenStrings.vbs
Externals\winimerge\ExpandEnvironmenStrings.js = Externals\winimerge\ExpandEnvironmenStrings.s
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SampleStatic", "Externals\crystaledit\Sample\SampleStatic.vcxproj", "{C347D6AE-7A2B-4ED0-97AD-2595E1C5D7DD}"
Expand Down Expand Up @@ -308,10 +308,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{4407E7D0
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scripts", "Scripts", "{88571237-56AD-421A-8F88-26983BDD8D6C}"
ProjectSection(SolutionItems) = preProject
Tools\Scripts\CheckMenuResources.vbs = Tools\Scripts\CheckMenuResources.vbs
Tools\Scripts\CheckMenuResources.js = Tools\Scripts\CheckMenuResources.js
Tools\Scripts\CheckTranslationStrings.cmd = Tools\Scripts\CheckTranslationStrings.cmd
Tools\Scripts\CheckTranslationStrings.ps1 = Tools\Scripts\CheckTranslationStrings.ps1
Tools\Scripts\CheckUnusedResources.vbs = Tools\Scripts\CheckUnusedResources.vbs
Tools\Scripts\CheckUnusedResources.js = Tools\Scripts\CheckUnusedResources.js
Tools\Scripts\README.md = Tools\Scripts\README.md
Tools\Scripts\UpdateTranslations.bat = Tools\Scripts\UpdateTranslations.bat
EndProjectSection
Expand Down Expand Up @@ -353,7 +353,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "q", "q", "{E4EF583F-653D-44
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PluginTests", "PluginTests", "{9738877F-0B01-4C37-855E-7465C5AB7B56}"
ProjectSection(SolutionItems) = preProject
Testing\PluginTests\PluginTests.vbs = Testing\PluginTests\PluginTests.vbs
Testing\PluginTests\PluginTests.js = Testing\PluginTests\PluginTests.js
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "yq", "yq", "{9914C8A9-0DEA-4922-9065-57034EE5263D}"
Expand Down
12 changes: 6 additions & 6 deletions ALL.vs2022.sln
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Root", "Root", "{DC3B258E-4
BuildManual.cmd = BuildManual.cmd
CreateRelease.cmd = CreateRelease.cmd
DownloadDeps.cmd = DownloadDeps.cmd
ExpandEnvironmenStrings.vbs = ExpandEnvironmenStrings.vbs
ExpandEnvironmenStrings.js = ExpandEnvironmenStrings.js
LICENSE.md = LICENSE.md
README.md = README.md
runastyle.bat = runastyle.bat
Expand Down Expand Up @@ -165,9 +165,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Batch Files", "Batch Files"
Externals\winimerge\SetVersion.cmd = Externals\winimerge\SetVersion.cmd
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "VBS Scripts", "VBS Scripts", "{0AB212AD-1F11-4BAB-BAD5-8BFC4435F453}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scripts", "Scripts", "{0AB212AD-1F11-4BAB-BAD5-8BFC4435F453}"
ProjectSection(SolutionItems) = preProject
Externals\winimerge\ExpandEnvironmenStrings.vbs = Externals\winimerge\ExpandEnvironmenStrings.vbs
Externals\winimerge\ExpandEnvironmenStrings.js = Externals\winimerge\ExpandEnvironmenStrings.js
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SampleStatic", "Externals\crystaledit\Sample\SampleStatic.vcxproj", "{C347D6AE-7A2B-4ED0-97AD-2595E1C5D7DD}"
Expand Down Expand Up @@ -308,10 +308,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{4407E7D0
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scripts", "Scripts", "{88571237-56AD-421A-8F88-26983BDD8D6C}"
ProjectSection(SolutionItems) = preProject
Tools\Scripts\CheckMenuResources.vbs = Tools\Scripts\CheckMenuResources.vbs
Tools\Scripts\CheckMenuResources.js = Tools\Scripts\CheckMenuResources.js
Tools\Scripts\CheckTranslationStrings.cmd = Tools\Scripts\CheckTranslationStrings.cmd
Tools\Scripts\CheckTranslationStrings.ps1 = Tools\Scripts\CheckTranslationStrings.ps1
Tools\Scripts\CheckUnusedResources.vbs = Tools\Scripts\CheckUnusedResources.vbs
Tools\Scripts\CheckUnusedResources.js = Tools\Scripts\CheckUnusedResources.js
Tools\Scripts\README.md = Tools\Scripts\README.md
Tools\Scripts\UpdateTranslations.bat = Tools\Scripts\UpdateTranslations.bat
EndProjectSection
Expand Down Expand Up @@ -353,7 +353,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "q", "q", "{E4EF583F-653D-44
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PluginTests", "PluginTests", "{9738877F-0B01-4C37-855E-7465C5AB7B56}"
ProjectSection(SolutionItems) = preProject
Testing\PluginTests\PluginTests.vbs = Testing\PluginTests\PluginTests.vbs
Testing\PluginTests\PluginTests.js = Testing\PluginTests\PluginTests.js
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "yq", "yq", "{9914C8A9-0DEA-4922-9065-57034EE5263D}"
Expand Down
2 changes: 1 addition & 1 deletion BuildArc.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if "%1" == "" (

del "%DISTDIR%\winmerge-%SAFEAPPVER%-full-src.7z" 2> NUL

7z.exe a -t7z -xr!*.gcno -xr!*.gcda -xr!*.gcov -xr!*.orig -xr!*.o -xr!*.a -xr!.dep -xr!*.asm -xr!*.out -xr!debug_static* -xr!debug_shared* -xr!release_static* -xr!release_shared* -xr!*.bak -xr!*.lang -xr!*.db -xr!*.ncb -xr!*.sdf -xr!*.bsc -xr!*.opt -xr!*.plg -xr!*.suo -xr!*.obj -xr!*.ilk -xr!*.pdb -xr!*.pch -xr!*.res -xr!*.exe -xr!*.sbr -xr!.vs -xr!*.VC.db-* -xr!*.zip -xr!WinMergeSplash.psd -xr!*.lib -xr!*.exp -xr!*.idb -xr!*.%COMPUTERNAME%.%USERNAME%.user -xr!BuildLog.htm -xr!ipch -xr!*.tlb -xr!*.tlog -xr!*.*~ -xr!CVS -xr!.svn -xr!.hg -xr!*.log -xr!*.lastbuildstate -xr!FreeImage*.dll -xr!WinIMergeLib.dll -xr!WinIMerge.exe -xr!WinWebDiff.dll -xr!WinWebDiff.exe -xr!BuildTmp -xr!Docs\Manual\Tools "%DISTDIR%\winmerge-%SAFEAPPVER%-full-src.7z" ArchiveSupport ColorSchemes Docs Externals Filters Installer Plugins ShellExtension Src Testing Tools Translations Web readme.txt Version.h Version.in *.cmd *.bat *.inf *.sln *.vbs
7z.exe a -t7z -xr!*.gcno -xr!*.gcda -xr!*.gcov -xr!*.orig -xr!*.o -xr!*.a -xr!.dep -xr!*.asm -xr!*.out -xr!debug_static* -xr!debug_shared* -xr!release_static* -xr!release_shared* -xr!*.bak -xr!*.lang -xr!*.db -xr!*.ncb -xr!*.sdf -xr!*.bsc -xr!*.opt -xr!*.plg -xr!*.suo -xr!*.obj -xr!*.ilk -xr!*.pdb -xr!*.pch -xr!*.res -xr!*.exe -xr!*.sbr -xr!.vs -xr!*.VC.db-* -xr!*.zip -xr!WinMergeSplash.psd -xr!*.lib -xr!*.exp -xr!*.idb -xr!*.%COMPUTERNAME%.%USERNAME%.user -xr!BuildLog.htm -xr!ipch -xr!*.tlb -xr!*.tlog -xr!*.*~ -xr!CVS -xr!.svn -xr!.hg -xr!*.log -xr!*.lastbuildstate -xr!FreeImage*.dll -xr!WinIMergeLib.dll -xr!WinIMerge.exe -xr!WinWebDiff.dll -xr!WinWebDiff.exe -xr!BuildTmp -xr!Docs\Manual\Tools "%DISTDIR%\winmerge-%SAFEAPPVER%-full-src.7z" ArchiveSupport ColorSchemes Docs Externals Filters Installer Plugins ShellExtension Src Testing Tools Translations Web readme.txt Version.h Version.in *.cmd *.bat *.inf *.sln *.js

(
echo "%DISTDIR%\WinMerge-%SAFEAPPVER%-Setup.exe"
Expand Down
2 changes: 1 addition & 1 deletion BuildBin.vs2017.cmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cd /d "%~dp0"

call SetVersion.cmd
cscript /nologo ExpandEnvironmenStrings.vbs Version.in > Version.h
cscript /nologo ExpandEnvironmenStrings.js Version.in > Version.h

setlocal
for /f "usebackq tokens=*" %%i in (`"%programfiles(x86)%\microsoft visual studio\installer\vswhere.exe" -version [15.0^,16.0^) -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do (
Expand Down
2 changes: 1 addition & 1 deletion BuildBin.vs2019.cmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cd /d "%~dp0"

call SetVersion.cmd
cscript /nologo ExpandEnvironmenStrings.vbs Version.in > Version.h
cscript /nologo ExpandEnvironmenStrings.js Version.in > Version.h

setlocal
for /f "usebackq tokens=*" %%i in (`"%programfiles(x86)%\microsoft visual studio\installer\vswhere.exe" -version [16.0^,17.0^) -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do (
Expand Down
2 changes: 1 addition & 1 deletion BuildBin.vs2022.cmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cd /d "%~dp0"

call SetVersion.cmd
cscript /nologo ExpandEnvironmenStrings.vbs Version.in > Version.h
cscript /nologo ExpandEnvironmenStrings.js Version.in > Version.h

setlocal
for /f "usebackq tokens=*" %%i in (`"%programfiles(x86)%\microsoft visual studio\installer\vswhere.exe" -version [17.0^,18.0^) -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do (
Expand Down
10 changes: 10 additions & 0 deletions ExpandEnvironmenStrings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
var fso = new ActiveXObject("Scripting.FileSystemObject");
var sh = new ActiveXObject("WScript.Shell");
var otf = fso.OpenTextFile(WScript.Arguments.Unnamed(0), 1);

while (!otf.AtEndOfStream) {
WScript.Echo(sh.ExpandEnvironmentStrings(otf.ReadLine()));
}

otf.Close();

10 changes: 0 additions & 10 deletions ExpandEnvironmenStrings.vbs

This file was deleted.

2 changes: 1 addition & 1 deletion Externals/winimerge
16 changes: 8 additions & 8 deletions Plugins/Plugins.xml
Original file line number Diff line number Diff line change
Expand Up @@ -216,24 +216,24 @@
</unpack-file>
</plugin>
<!--
<plugin name="VBScript-test">
<plugin name="JScript-test">
<event value="FILE_PACK_UNPACK" />
<description value="VBScript test" />
<description value="JScript test" />
<file-filters value="\.nomatch$" />
<is-automatic value="false" />
<unpacked-file-extension value=".txt" />
<unpack-file>
<command>cmd /c cscript //nologo "${SCRIPT_FILE}" "${SRC_FILE}" > "${DST_FILE}"</command>
<script fileExtension=".vbs">
WScript.StdOut.WriteLine "Hello World!"
WScript.StdOut.WriteLine WScript.Arguments(0)
<script fileExtension=".js">
WScript.StdOut.WriteLine("Hello World!");
WScript.StdOut.WriteLine(WScript.Arguments.Item(0));
</script>
</unpack-file>
<pack-file>
<command>cmd /c cscript //nologo "${SCRIPT_FILE}" "${SRC_FILE}" > "${DST_FILE}"</command>
<script fileExtension=".vbs">
WScript.StdOut.WriteLine "!dlroW olleH"
WScript.StdOut.WriteLine WScript.Arguments(0)
<script fileExtension=".js">
WScript.StdOut.WriteLine("!dlroW olleH");
WScript.StdOut.WriteLine(WScript.Arguments.Item(0));
</script>
</pack-file>
</plugin>
Expand Down
Loading

0 comments on commit b133ce2

Please sign in to comment.