Stringscan

Check-in [943324f2d0]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add files to Windows build
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 943324f2d00598e0edcf6499732bf3bcff9792de6f76ce9817cc3f2428578ecd
User & Date: kevin 2017-07-08 03:14:32
Context
2017-07-08
23:11
Add acclerators check-in: 4152534079 user: kevin tags: trunk
03:14
Add files to Windows build check-in: 943324f2d0 user: kevin tags: trunk
02:50
Add batch scripts check-in: fe8657abf3 user: kevin tags: trunk
Changes
Hide Diffs Unified Diffs Show Whitespace Changes Patch

Changes to buildexe.bat.

1
gcc  icons.o versioninfo.o stringscan.c -I %1\include -L%1\libs -L%1\DLLs -lShlwapi -lpython35 -o StringScan.exe
|
1
C:/Users/kevin/Desktop/ruby-relative/rubyinstaller/sandbox/devkit/mingw/bin/gcc -v -Wall stringscan.c -m64 -IC:/Users/kevin/Desktop/ruby23_mingw_loadrelative/include/ruby-2.3.0/x64-mingw32 -IC:/Users/kevin/Desktop/ruby23_mingw_loadrelative/include/ruby-2.3.0 -LC:/Users/kevin/Desktop/ruby23_mingw_loadrelative/lib -LC:/Users/kevin/Desktop/ruby23_mingw_loadrelative/bin -llibx64-msvcrt-ruby230  -lShlwapi -o Stringscan.exe

Added icons.rc.



>
1
APPICONS ICON "stringscan.ico"

Changes to install.bat.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
@echo off
::configure and install app files
set install_dir="%appdata%\StringScan_App\"
set config_dir="%appdata%\StringScan\"
set config
if not exist %install_dir% (
mkdir %install_dir%
)
 
if not exist %config_dir% (
mkdir %config_dir%
)
call 7za  x stringscan.zip
xcopy bin %install_dir%\bin /s /i /y
xcopy lib %install_dir%\lib /s /i /y
xcopy stringscan %install_dir%\stringscan /s /i /y
copy /Y uninstall.bat %config_dir%\
copy /Y stringscan.ico %config_dir%\

::test for key, add to registry
reg query "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\StringScan.exe"
if errorlevel 0 (
reg delete "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\StringScan.exe" /f
)
reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\StringScan.exe" /f
reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\StringScan.exe"  /ve /d "%appdata%\StringScan_App\stringscan\StringScan.exe" /f
 
reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\StringScan" /f
reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\StringScan" /f /v "DisplayIcon" /t REG_SZ /d "%appdata%\StringScan\stringscan.ico"
reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\StringScan" /f /v "DisplayName" /t REG_SZ /d "StringScan"
reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\StringScan" /f /v "InstallLocation" /t REG_SZ /d "%install_dir%"

reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\StringScan" /f /v "Publisher" /t REG_SZ /d "WordTech Communications LLC"
reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\StringScan" /f /v "InstallDate" /t REG_SZ /d %DATE%
reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\StringScan" /f /v "Version" /t REG_SZ /d 6.0.0
 
reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\StringScan" /f /v "UninstallString" /t REG_SZ /d "cmd /c %appdata%\StringScan\uninstall.bat"
 
::add to start menu
set startdir="%appdata%\Microsoft\Windows\Start Menu\StringScan\"

if not exist %startdir% (
mkdir %startdir%
)
cd %startdir%

::mklink /H StringScan.exe "%appdata%\StringScan_App\stringscan\StringScan.exe"

echo Set oWS = WScript.CreateObject("WScript.Shell") >%temp%\link.vbs
echo sLinkFile = "StringScan.lnk" >>  %temp%\link.vbs
echo Set oLink = oWS.CreateShortcut(sLinkFile) >>  %temp%\link.vbs
echo oLink.TargetPath = "%appdata%\StringScan_App\stringscan\StringScan.exe" >> %temp%\link.vbs
echo oLink.Save >>  %temp%\link.vbs
call  %temp%\link.vbs
del %temp%\link.vbs

cd C:\Users\%username%\Desktop
echo Done.


|
|
















|

|

|
|

|
|
|
|

|
|
|

|


|






|


|

|






1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
@echo off
::configure and install app files
set install_dir="%appdata%\Stringscan_App\"
set config_dir="%appdata%\Stringscan\"
set config
if not exist %install_dir% (
mkdir %install_dir%
)
 
if not exist %config_dir% (
mkdir %config_dir%
)
call 7za  x stringscan.zip
xcopy bin %install_dir%\bin /s /i /y
xcopy lib %install_dir%\lib /s /i /y
xcopy stringscan %install_dir%\stringscan /s /i /y
copy /Y uninstall.bat %config_dir%\
copy /Y stringscan.ico %config_dir%\

::test for key, add to registry
reg query "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Stringscan.exe"
if errorlevel 0 (
reg delete "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Stringscan.exe" /f
)
reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Stringscan.exe" /f
reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Stringscan.exe"  /ve /d "%appdata%\Stringscan_App\stringscan\Stringscan.exe" /f
 
reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Stringscan" /f
reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Stringscan" /f /v "DisplayIcon" /t REG_SZ /d "%appdata%\Stringscan\stringscan.ico"
reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Stringscan" /f /v "DisplayName" /t REG_SZ /d "Stringscan"
reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Stringscan" /f /v "InstallLocation" /t REG_SZ /d "%install_dir%"

reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Stringscan" /f /v "Publisher" /t REG_SZ /d "WordTech Communications LLC"
reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Stringscan" /f /v "InstallDate" /t REG_SZ /d %DATE%
reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Stringscan" /f /v "Version" /t REG_SZ /d 1.0.0
 
reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Stringscan" /f /v "UninstallString" /t REG_SZ /d "cmd /c %appdata%\Stringscan\uninstall.bat"
 
::add to start menu
set startdir="%appdata%\Microsoft\Windows\Start Menu\Stringscan\"

if not exist %startdir% (
mkdir %startdir%
)
cd %startdir%

::mklink /H Stringscan.exe "%appdata%\Stringscan_App\stringscan\Stringscan.exe"

echo Set oWS = WScript.CreateObject("WScript.Shell") >%temp%\link.vbs
echo sLinkFile = "Stringscan.lnk" >>  %temp%\link.vbs
echo Set oLink = oWS.CreateShortcut(sLinkFile) >>  %temp%\link.vbs
echo oLink.TargetPath = "%appdata%\Stringscan_App\stringscan\Stringscan.exe" >> %temp%\link.vbs
echo oLink.Save >>  %temp%\link.vbs
call  %temp%\link.vbs
del %temp%\link.vbs

cd C:\Users\%username%\Desktop
echo Done.

Added stringscan.c.

































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include <C:\Users\kevin\Desktop\ruby23_mingw_loadrelative\include\ruby-2.3.0\ruby.h>
#include <Windows.h>
#include <shlobj.h>
#include <shlwapi.h>
#include <tchar.h>
 
int main(int argc, char *argv[])
{

  TCHAR exedir [MAX_PATH];

  
#if 0 
  GetModuleFileName(NULL, exedir, MAX_PATH);
  _tprintf("%s/n", exedir);
  PathRemoveFileSpec(exedir);
  _tprintf("%s/n", exedir);
#endif

  /*Get the module's full path, and set to the current working directory.*/
  if (!GetModuleFileName(NULL, exedir, MAX_PATH)) {

    TCHAR errmsg[512];
    FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,0, GetLastError(),0,errmsg,1024,NULL);

    _tprintf( TEXT("The path is %s, and the error is %s/n"), exedir, errmsg );
  }


  if (!PathRemoveFileSpec(exedir)) {

    TCHAR errmsg[512];
    FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,0, GetLastError(),0,errmsg,1024,NULL);
    _tprintf( TEXT("The target dir is %s, and the error is %s/n"), exedir, errmsg );
  }

  if (!SetCurrentDirectory(exedir)) {

    TCHAR errmsg[512];
    FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,0, GetLastError(),0,errmsg,1024,NULL);
    _tprintf( TEXT("The working dir is %s, and the error is %s/n"), exedir,errmsg );
  }

//Now, let's initialize Ruby and pass the script to it.
  ruby_init();

 
  ruby_init_loadpath();
  
  char *file = "stringscan.rb";

  ruby_script(file); 

  char* options[] = { "", file,};

  void* node=ruby_options(2,options);

  //finally, run the interpreter
  ruby_run_node(node);

  return 0;
 

}

Added stringscan.ico.

cannot compute difference between binary files

Changes to uninstall.bat.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
@echo off
 
call :confirm
if "%yesno%"=="6" (
call :remove
) else (
call :cancel
)
exit /b
 
:confirm
::returns 6 = Yes, 7 = No.
set yesno=
echo wscript.echo MsgBox("Do you want to uninstall StringScan?", vbYesNo+vbInformation, "Uninstall") > %temp%\confirm.vbs
for /f "tokens=* delims=" %%a in ('cscript //nologo "%temp%\confirm.vbs"') do set yesno=%%a
del %temp%\confirm.vbs /f /q
exit /b
 
 
:remove
reg delete "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\StringScan.exe" /f
reg delete  "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\StringScan" /f
 
rmdir "%appdata%\Microsoft\Windows\Start Menu\StringScan" /s /q 
echo MsgBox "Uninstallation of StringScan is complete.", vbOKOnly+vbInformation, "Uninstall"> %temp%\remove.vbs
call %temp%\remove.vbs
del %temp%\remove.vbs /f /q
rd %appdata%\StringScan_App /s /q
start /b "" cmd /c rd "%appdata%\StringScan\" /s /q && exit
 
 
:cancel
echo MsgBox "Uninstallation of StringScan cancelled.",vbOKOnly+vbInformation, "Uninstall StringScan"  > %temp%\cancel.vbs
call %temp%\cancel.vbs
del %temp%\cancel.vbs /f /q
exit /b













|






|
|

|
|


|
|



|



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
@echo off
 
call :confirm
if "%yesno%"=="6" (
call :remove
) else (
call :cancel
)
exit /b
 
:confirm
::returns 6 = Yes, 7 = No.
set yesno=
echo wscript.echo MsgBox("Do you want to uninstall Stringscan?", vbYesNo+vbInformation, "Uninstall") > %temp%\confirm.vbs
for /f "tokens=* delims=" %%a in ('cscript //nologo "%temp%\confirm.vbs"') do set yesno=%%a
del %temp%\confirm.vbs /f /q
exit /b
 
 
:remove
reg delete "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Stringscan.exe" /f
reg delete  "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Stringscan" /f
 
rmdir "%appdata%\Microsoft\Windows\Start Menu\Stringscan" /s /q 
echo MsgBox "Uninstallation of Stringscan is complete.", vbOKOnly+vbInformation, "Uninstall"> %temp%\remove.vbs
call %temp%\remove.vbs
del %temp%\remove.vbs /f /q
rd %appdata%\Stringscan_App /s /q
start /b "" cmd /c rd "%appdata%\Stringscan\" /s /q && exit
 
 
:cancel
echo MsgBox "Uninstallation of Stringscan cancelled.",vbOKOnly+vbInformation, "Uninstall Stringscan"  > %temp%\cancel.vbs
call %temp%\cancel.vbs
del %temp%\cancel.vbs /f /q
exit /b

Added versioninfo.rc.











































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
1 VERSIONINFO
FILEVERSION 1, 0, 0, 0
PRODUCTVERSION 1, 0, 0, 0
FILEOS 4
FILETYPE 1
{
    BLOCK "StringFileInfo" {
        BLOCK "040904E4" {
            VALUE "FileDescription", "Text Search Tool"
            VALUE "OriginalFilename", "Stringscan"
            VALUE "CompanyName", "WordTech Communications LLC"
            VALUE "FileVersion", "1.0.0"
            VALUE "LegalCopyright", "(c) 2017 WordTech Communications LLC"
            VALUE "ProductName", "Stringscan"
            VALUE "ProductVersion", "1.0.0"
        }
    }
    BLOCK "VarFileInfo" {
        VALUE "Translation", 0x409, 1252
    }
}