Skip to content

Commit

Permalink
Merge pull request sakura-editor#161 from sakura-editor/master
Browse files Browse the repository at this point in the history
[x64対応] master の修正を x64 ブランチにマージする
  • Loading branch information
kobake authored Jun 23, 2018
2 parents 24d63a5 + 402b862 commit 43810d0
Show file tree
Hide file tree
Showing 18 changed files with 352 additions and 166 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.bat text eol=crlf
11 changes: 4 additions & 7 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: 1.0.{build}
image: Visual Studio 2017
init:
install:
- ps: Set-WinSystemLocale ja-JP
- ps: Start-Sleep -s 5
- ps: Restart-Computer
Expand All @@ -22,15 +22,12 @@ build_script:
echo CONFIGURATION %CONFIGURATION%
set EXTRA_CMD=/verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
call build-sln.bat %PLATFORM% %CONFIGURATION%
set MSBUILD_EXE="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe"
call build-chm.bat
call build-installer.bat %PLATFORM% %CONFIGURATION%
echo %MSBUILD_EXE% %SLN_FILE% /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /t:"Clean","Rebuild" %EXTRA_CMD%
%MSBUILD_EXE% %SLN_FILE% /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /t:"Clean","Rebuild" %EXTRA_CMD%
call zipArtifacts.bat %PLATFORM% %CONFIGURATION%
echo appveyor_yml
Expand Down
13 changes: 13 additions & 0 deletions build-chm.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
set HHC=C:\Program Files (x86)\HTML Help Workshop\hhc.exe

@rem hhc.exe returns 1 on success, and returns 0 on failure
"%HHC%" help\macro\macro.HHP
if %errorlevel% equ 0 (echo error && exit /b 1)

"%HHC%" help\plugin\plugin.hhp
if %errorlevel% equ 0 (echo error && exit /b 1)

"%HHC%" help\sakura\sakura.hhp
if %errorlevel% equ 0 (echo error && exit /b 1)

exit /b 0
45 changes: 45 additions & 0 deletions build-installer.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
set platform=%1
set configuration=%2
set INSTALLER_RESOURCES=installer\temp
set INSTALLER_WORK=installer\sakura
set INSTALLER_OUTPUT=installer\Output

set INSTALLER_RESOURCES_SINT=installer\temp\sint
set INSTALLER_RESOURCES_BRON=installer\temp\bron

if exist "%INSTALLER_RESOURCES%" rmdir /s /q "%INSTALLER_RESOURCES%"
if exist "%INSTALLER_WORK%" rmdir /s /q "%INSTALLER_WORK%"
if exist "%INSTALLER_OUTPUT%" rmdir /s /q "%INSTALLER_OUTPUT%"

if exist "%INSTALLER_RESOURCES_SINT%" rmdir /s /q "%INSTALLER_RESOURCES_SINT%"
if exist "%INSTALLER_RESOURCES_BRON%" rmdir /s /q "%INSTALLER_RESOURCES_BRON%"

7z x installer\sinst_src.zip -O"%INSTALLER_RESOURCES_SINT%" || (echo error && exit /b 1)
7z x installer\externals\bregonig\bron412.zip -O"%INSTALLER_RESOURCES_BRON%" || (echo error && exit /b 1)

mkdir %INSTALLER_WORK%
mkdir %INSTALLER_WORK%\keyword

copy %INSTALLER_RESOURCES_SINT%\sakura.exe.manifest.x %INSTALLER_WORK%\
copy %INSTALLER_RESOURCES_SINT%\sakura.exe.manifest.v %INSTALLER_WORK%\
copy %INSTALLER_RESOURCES_SINT%\sakura.exe.ini %INSTALLER_WORK%\
copy %INSTALLER_RESOURCES_SINT%\keyword\*.* %INSTALLER_WORK%\keyword\

if "%platform%" == "x64" (
copy %INSTALLER_RESOURCES_BRON%\x64\*.dll %INSTALLER_WORK%\
) else (
copy %INSTALLER_RESOURCES_BRON%\*.dll %INSTALLER_WORK%\
)
copy %INSTALLER_RESOURCES_BRON%\*.txt %INSTALLER_WORK%\

copy help\sakura\sakura.chm %INSTALLER_WORK%\
copy help\plugin\plugin.chm %INSTALLER_WORK%\
copy help\macro\macro.chm %INSTALLER_WORK%\

copy %platform%\%configuration%\*.exe %INSTALLER_WORK%\
copy %platform%\%configuration%\*.dll %INSTALLER_WORK%\

"C:\Program Files (x86)\Inno Setup 5\ISCC.exe" installer\sakura.iss || (echo error && exit /b 1)

if exist "%INSTALLER_RESOURCES%" rmdir /s /q "%INSTALLER_RESOURCES%"
if exist "%INSTALLER_WORK%" rmdir /s /q "%INSTALLER_WORK%"
18 changes: 18 additions & 0 deletions build-sln.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
set platform=%1
set configuration=%2

@rem https://www.appveyor.com/docs/environment-variables/

if "%APPVEYOR%"=="True" (
set EXTRA_CMD=/verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
) else (
set EXTRA_CMD=
)

set MSBUILD_EXE="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe"

@echo %MSBUILD_EXE% %SLN_FILE% /p:Platform=%platform% /p:Configuration=%configuration% /t:"Clean","Rebuild" %EXTRA_CMD%
%MSBUILD_EXE% %SLN_FILE% /p:Platform=%platform% /p:Configuration=%configuration% /t:"Clean","Rebuild" %EXTRA_CMD%
if %errorlevel% neq 0 (echo error && exit /b 1)

exit /b 0
Binary file added installer/externals/bregonig/bron412.zip
Binary file not shown.
19 changes: 19 additions & 0 deletions installer/externals/bregonig/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
正規表現ライブラリ bregonig.dll

■ Website

http://k-takata.o.oo7.jp/mysoft/bregonig.html


■ バイナリ入手先

https://bitbucket.org/k_takata/bregonig/downloads/bron412.zip

■ ソースコード

http://github.com/k-takata/bregonig


■ ライセンス

http://k-takata.o.oo7.jp/mysoft/bregonig.html#SCT-9.
7 changes: 7 additions & 0 deletions installer/externals/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
外部の依存モジュールを入れるためのフォルダです。

このフォルダ以下に入れるモジュールに対して readme を書く際には
GitHub での文字化けを防ぐため UTF-8 BOM 付きで保存してください。

Website アドレス、ライセンス、バイナリのアドレス、(オープンソースなら)ソースコード入手先を
記載してください。
37 changes: 34 additions & 3 deletions installer/sakura.iss
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#define MyAppVer GetFileVersion("sakura\sakura.exe")
#define MyAppVerH StringChange(MyAppVer, ".", "-")

[Setup]
AppName=サクラエディタ
AppId=sakura editor
Expand All @@ -19,8 +22,8 @@ DisableStartupPrompt=no
PrivilegesRequired=None

; エディタのバージョンに応じて書き換える場所
OutputBaseFilename=sakura_install2-1-1-2
VersionInfoVersion=2.1.1.2
OutputBaseFilename=sakura_install{#MyAppVerH}
VersionInfoVersion={#MyAppVer}

; OSバージョン制限
MinVersion=0,5.0
Expand Down Expand Up @@ -50,6 +53,7 @@ Name: sendto; Description: "

[Files]
Source: "sakura\sakura.exe"; DestDir: "{app}"; Components: main; Flags: ignoreversion;
Source: "sakura\sakura_lang_en_US.dll";DestDir: "{app}"; Components: main; Flags: ignoreversion;
Source: "sakura\bregonig.dll"; DestDir: "{app}"; Components: main
Source: "sakura\bsd_license.txt"; DestDir: "{app}"; Components: main
Source: "sakura\sakura.exe.manifest.x";DestDir: "{app}"; Components: main; DestName: "sakura.exe.manifest"; Check: isMultiUserDisabled; Flags: onlyifdoesntexist;
Expand All @@ -73,7 +77,8 @@ Root: HKCU; Subkey: "SOFTWARE\Classes\*\shell\sakuraeditor\command"; ValueType:
Root: HKCU; Subkey: "SOFTWARE\Classes\Applications\sakura.exe\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\sakura.exe"" ""%1"""; Tasks: proglist; Flags: uninsdeletekey; Check: CheckPrivilege(false)

[Icons]
Name: "{group}\サクラエディタ"; Filename: "{app}\sakura.exe"; Components: main; Tasks: startmenu;
Name: "{group}\サクラエディタ"; Filename: "{app}\sakura.exe"; Components: main; Check: InTopMenu(false); Tasks: startmenu;
Name: "{userstartmenu}\サクラエディタ"; Filename: "{app}\sakura.exe"; Components: main; Check: InTopMenu(true); Tasks: startmenu;
Name: "{group}\ヘルプファイル"; Filename: "{app}\sakura.chm"; Components: help; Tasks: startmenu;
Name: "{group}\設定フォルダ"; Filename: "%APPDATA%\sakura"; Components: main; Check: isMultiUserEnabled; Tasks: startmenu;
Name: "{userdesktop}\サクラエディタ"; Filename: "{app}\sakura.exe"; Components: main; Tasks: desktopicon;
Expand Down Expand Up @@ -155,6 +160,32 @@ begin
Result := UsingWinNT and (( GetWindowsVersion shr 24) >= 5 );
end;
function IsWin10OrLater : Boolean;
var
Version: TWindowsVersion;
begin
GetWindowsVersionEx(Version);
if (Version.Major >= 10) then
begin
Result := True;
end else begin
Result := False;
end;
end;
function InTopMenu( TopMenu : Boolean ) : Boolean;
begin
if TopMenu then
begin
if IsWin10OrLater then
begin
Result := True;
end else begin
Result := False;
end
end else begin
Result := True;
end;
end;
{ **********************************
Custom Wizard Page
********************************** }
Expand Down
53 changes: 47 additions & 6 deletions sakura/preBuild.bat
Original file line number Diff line number Diff line change
@@ -1,18 +1,54 @@
@echo off

@echo =======================
@echo preBuild
@echo =======================

@echo.
@echo ---- HeaderMake ----
HeaderMake -in=..\sakura_core\Funccode_x.hsrc -out=..\sakura_core\Funccode_define.h -mode=define
HeaderMake -in=..\sakura_core\Funccode_x.hsrc -out=..\sakura_core\Funccode_enum.h -mode=enum -enum=EFunctionCode
MakefileMake -file=..\sakura_core\Makefile -dir=..\sakura_core

set GITREV_H=..\sakura_core\gitrev.h
@echo.
@echo ---- MakefileMake ----
MakefileMake -file=..\sakura_core\Makefile -dir=..\sakura_core

for /f "usebackq" %%s in (`git show -s --format^=%%H`) do (
set COMMITID=%%s
@echo.
@echo ---- Make gitrev.h ----
: Git enabled checking
set GIT_ENABLED=1
where git 1>nul 2>&1
if not "%ERRORLEVEL%" == "0" (
set GIT_ENABLED=0
@echo NOTE: No git command
)
for /f "usebackq" %%s in (`git show -s --format^=%%h`) do (
set SHORT_COMMITID=%%s
if not exist ..\.git (
set GIT_ENABLED=0
@echo NOTE: No .git directory
)

: Get git hash if git is enabled
if "%GIT_ENABLED%" == "1" (
for /f "usebackq" %%s in (`git show -s --format^=%%H`) do (
set COMMITID=%%s
)
for /f "usebackq" %%s in (`git show -s --format^=%%h`) do (
set SHORT_COMMITID=%%s
)
for /f "usebackq" %%s in (`git config --get remote.origin.url`) do (
set GIT_URL=%%s
)
) else (
set SHORT_COMMITID=
set COMMITID=
set GIT_URL=
)
@echo SHORT_COMMITID: %SHORT_COMMITID%
@echo COMMITID: %COMMITID%
@echo GIT_URL: %GIT_URL%

: Output gitrev.h
set GITREV_H=..\sakura_core\gitrev.h
type nul > %GITREV_H%
if "%COMMITID%" == "" (
type nul >> %GITREV_H%
Expand All @@ -24,6 +60,11 @@ if "%SHORT_COMMITID%" == "" (
) else (
echo #define GIT_SHORT_COMMIT_HASH "%SHORT_COMMITID%" >> %GITREV_H%
)
if "%GIT_URL%" == "" (
type nul >> %GITREV_H%
) else (
echo #define GIT_URL "%GIT_URL%" >> %GITREV_H%
)

ENDLOCAL
rem exit 0
Loading

0 comments on commit 43810d0

Please sign in to comment.