From 6aef9c937526f122092661e7dd818adcc5122530 Mon Sep 17 00:00:00 2001 From: Masaru Tsuchiyama Date: Sun, 24 Jun 2018 18:11:22 +0900 Subject: [PATCH 1/5] =?UTF-8?q?sakura.iss=20=E3=82=92=E3=82=B3=E3=83=94?= =?UTF-8?q?=E3=83=BC=E3=81=97=E3=81=A6=20x64=20=E7=94=A8=E3=82=92=E4=BD=9C?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- installer/sakura-x64.iss | 357 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 357 insertions(+) create mode 100644 installer/sakura-x64.iss diff --git a/installer/sakura-x64.iss b/installer/sakura-x64.iss new file mode 100644 index 0000000000..4a33220c04 --- /dev/null +++ b/installer/sakura-x64.iss @@ -0,0 +1,357 @@ +#if VER < EncodeVer(5,6,1) + #define MySendTo "{sendto}" +#else + #define MySendTo "{usersendto}" +#endif +#define MyAppVer GetFileVersion("sakura\sakura.exe") +#define MyAppVerH StringChange(MyAppVer, ".", "-") + +[Setup] +AppName=サクラエディタ +AppId=sakura editor +AppVersion={#MyAppVer} +AppVerName=sakura editor(サクラエディタ) {#MyAppVer} +AppMutex=MutexSakuraEditor +AppPublisher=サクラエディタ開発チーム +AppPublisherURL=http://sakura-editor.sourceforge.net +AppSupportURL=http://sakura-editor.sourceforge.net +AppUpdatesURL=http://sourceforge.net/projects/sakura-editor/ +DefaultDirName={code:getDefautDirName|sakura} +DefaultGroupName=サクラエディタ +UninstallDisplayIcon={app}\sakura.exe +InfoBeforeFile="instmaterials\info.txt" + +WizardImageFile="instmaterials\SetupModern20.bmp" +WizardSmallImageFile="instmaterials\SetupModernSmall20.bmp" +DisableStartupPrompt=no + +PrivilegesRequired=None + +; エディタのバージョンに応じて書き換える場所 +OutputBaseFilename=sakura_install{#MyAppVerH} +VersionInfoVersion={#MyAppVer} +VersionInfoProductVersion={#MyAppVer} + +; OSバージョン制限 +MinVersion=0,5.0 + +[Languages] +Name: "ja"; MessagesFile: "compiler:Languages\Japanese.isl" + +[Types] +Name: all; Description: "All" +Name: editorwithhelp; Description: "Editor with Help" +Name: editoronly; Description: "Editor Only" +Name: custom; Description: "カスタム"; Flags: iscustom + +[Components] +Name: main; Description: "サクラエディタ本体"; Types: all editorwithhelp editoronly custom; Flags: fixed +Name: help; Description: "ヘルプファイル"; Types: all editorwithhelp +Name: keyword; Description: "KeyWordファイル"; Types: all + +[Tasks] +Name: startmenu; Description: "スタートメニューを作成(&S)"; Components: main; +Name: quicklaunch; Description: "Quick Launchにアイコン作成(&Q)"; Components: main; +Name: proglist; Description: "プログラム一覧に追加(&P)"; Components: main; +Name: desktopicon; Description: "デスクトップにアイコン作成(&D)"; Components: main; Flags: unchecked; +Name: fileassoc; Description: "「SAKURAで開く」メニューの追加(&E)"; Components: main; Flags: unchecked; +Name: startup; Description: "起動時に常駐(&B)"; Components: main; Flags: unchecked; +Name: sendto; Description: "送るに追加(&T)"; Components: main; Flags: unchecked; + +[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; +Source: "sakura\sakura.exe.manifest.v";DestDir: "{app}"; Components: main; DestName: "sakura.exe.manifest"; Check: isMultiUserEnabled; Flags: onlyifdoesntexist; +Source: "sakura\sakura.chm"; DestDir: "{app}"; Components: help +Source: "sakura\macro.chm"; DestDir: "{app}"; Components: help +Source: "sakura\plugin.chm"; DestDir: "{app}"; Components: help +Source: "sakura\sakura.exe.ini"; DestDir: "{app}"; Components: main; Check: isMultiUserEnabled; Flags: onlyifdoesntexist; + +Source: "sakura\keyword\*"; DestDir: "{app}\keyword"; Components: keyword; Flags: recursesubdirs + +[Registry] +; registry for all user (Admin only) +Root: HKLM; Subkey: "SOFTWARE\Classes\*\shell\sakuraeditor"; ValueType: string; ValueName: ""; ValueData: "SAKURAで開く(&E)"; Tasks: fileassoc; Flags: uninsdeletekey; Check: CheckPrivilege(true) +Root: HKLM; Subkey: "SOFTWARE\Classes\*\shell\sakuraeditor\command"; ValueType: string; ValueName: ""; ValueData: """{app}\sakura.exe"" ""%1"""; Tasks: fileassoc; Flags: uninsdeletekey; Check: CheckPrivilege(true) +Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\sakura.exe\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\sakura.exe"" ""%1"""; Tasks: proglist; Flags: uninsdeletekey; Check: CheckPrivilege(true) + +; registry for each user (non-Admin only) +Root: HKCU; Subkey: "SOFTWARE\Classes\*\shell\sakuraeditor"; ValueType: string; ValueName: ""; ValueData: "SAKURAで開く(&E)"; Tasks: fileassoc; Flags: uninsdeletekey; Check: CheckPrivilege(false) +Root: HKCU; Subkey: "SOFTWARE\Classes\*\shell\sakuraeditor\command"; ValueType: string; ValueName: ""; ValueData: """{app}\sakura.exe"" ""%1"""; Tasks: fileassoc; Flags: uninsdeletekey; Check: CheckPrivilege(false) +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; 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; +Name: "{group}\アンインストール"; Filename: "{uninstallexe}"; Tasks: startmenu; +Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\サクラエディタ"; Filename: "{app}\sakura.exe"; Components: main; Tasks: quicklaunch; +Name: "{userstartup}\サクラエディタ常駐"; Filename: "{app}\sakura.exe"; Parameters: "-NOWIN"; Components: main; Tasks: startup; +Name: "{#MySendTo}\サクラエディタ"; Filename: "{app}\sakura.exe"; Components: main; Tasks: sendto; + +[Run] +FileName: "{app}\sakura.exe"; Description: "今すぐサクラエディタを起動"; WorkingDir: "{app}"; Flags: postinstall nowait skipifsilent; Check: CheckPrivilege(false); + +[UninstallDelete] +;Uninstall時に確認無く消されるのでコメントアウト +;Type: files; Name: "{app}\sakura.ini" + +[Dirs] +Name: "{userappdata}\sakura"; Components: main; Tasks: startmenu; Check: isMultiUserEnabled + +[Code] +var + MultiUserPage: TInputOptionWizardPage; + MultiUserPageEnabled : Boolean; + +{ ********************************** + Utility Functions + ********************************** } + +function isMultiUserEnabled : Boolean; +begin + Result := False; + if MultiUserPageEnabled then + Result := MultiUserPage.Values[0]; +end; + +function isMultiUserDisabled : Boolean; +begin + Result := not isMultiUserEnabled; +end; + +function CheckPrivilege( admin: Boolean ) : Boolean; +begin + if admin then + begin + Result := IsAdminLoggedOn; + end + else + begin + Result := not IsAdminLoggedOn; + end; +end; + +{ + default installation target directory + Admin: Program Files\sakura + User: \sakura +} +function getDefautDirName( progdir : String ) : String; +var + basedir : String; +begin + if IsAdminLoggedOn then + begin + basedir := ExpandConstant( '{pf}' ); + end + else + begin + basedir := ExpandConstant( '{userappdata}' ); + end; + Result := basedir + '\' + progdir; +end; + +function IsVistaOrLater : Boolean; +begin + Result := UsingWinNT and (( GetWindowsVersion shr 24) >= 6 ); +end; + +function IsWin2kOrLater : Boolean; +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 + ********************************** } + +{ Callback event functions } + +function NextButtonClickMultiUser( Sender : TWizardPage): Boolean; +var + selected: Integer; +{ t : String;} +begin + Result := True; + if MultiUserPageEnabled then + begin + +{ DEBUG CODE + t := 'MultiUser Setting :'; + if IsAdminLoggedOn then + t := t + 'Administrator '; + if ((GetWindowsVersion shr 24) >= 6 ) then + t := t + 'Vista '; + if MultiUserPage.Values[0] = False then + t := t + 'SingleUser '; + t := t + Format( 'WinVer: %.8x', [GetWindowsVersion] ); + MsgBox( t, mbConfirmation, MB_OK); +} + + { Alert if admin mode && multi user = False } + if IsAdminLoggedOn and + IsVistaOrLater and + ( MultiUserPage.Values[0] = False ) then + begin + selected := MsgBox( +{ 'Program Files等のシステムフォルダへインストールする場合はUACを無効にしないと設定が保存できませんがよろしいですか?',} + '互換モードでインストールします.システムファイルおよびプログラムをユーザ権限で編集すると編集結果が他のアプリケーションから参照できないことがあります.(VirtualStore機能)', + mbConfirmation, + ( MB_OKCANCEL )); + if selected = IDCANCEL then + Result := False; + end; + end; +end; + +function ShoudSkipMultiUser(Sender : TWizardPage ): Boolean; +var + selectdir : String; + prev_version_h, prev_version_l : Cardinal; +begin + Result := False; + if ( not MultiUserPageEnabled ) then + Result := True + else + begin + selectdir := AddBackslash(ExpandConstant( '{app}' )); + if FileExists( selectdir + 'sakura.exe' ) then + begin + Result := True; + if GetIniInt( 'Settings', 'MultiUser', 0, 0, 1, selectdir + 'sakura.exe.ini' ) = 1 then + MultiUserPage.Values[0] := True + else + MultiUserPage.Values[0] := False; + end; + end; +end; + +{ ********************************** + System Event Functions + ********************************** } + +{ Add multi user selection page if supported } +procedure InitializeWizard; +begin + { Create multi user page } + MultiUserPage := CreateInputOptionPage( wpSelectComponents, '設定保存方法の選択', + '設定をユーザ毎に保存するか実行ファイルの場所へ保存するかを選択してください', + 'よくわからない場合は変更しないでください', False, False ); + MultiUserPage.Add( '設定をユーザ毎に個別に管理する' ); + MultiUserPage.Values[0] := False; + MultiUserPage.OnShouldSkipPage := @ShoudSkipMultiUser; + MultiUserPage.OnNextButtonClick := @NextButtonClickMultiUser; + MultiUserPageEnabled := False; + {Show multiuser mode configuration only in case of Win2K or later } + if IsWin2kOrLater then + begin + { multi user mode is supported } + MultiUserPageEnabled := True; + + { + default multi user mode + User: OFF because installation target is also local + Admin: + Vista or later: ON + Other: OFF + } + if IsVistaOrLater and + IsAdminLoggedOn then + MultiUserPage.Values[0] := True + else + MultiUserPage.Values[0] := False; + end; +end; + +{ Build List of installation configuration for ready page } +function UpdateReadyMemo(Space, NewLine, MemoUserInfoInfo, MemoDirInfo, MemoTypeInfo, + MemoComponentsInfo, MemoGroupInfo, MemoTasksInfo: String): String; +var + MemoMuitiUser, MemoVirtualStore : String; +begin + MemoMuitiUser := '設定ファイル等格納場所' + NewLine + Space; + MemoVirtualStore := 'VirtualStore' + NewLine + Space; + + if isMultiUserEnabled then + begin + MemoMuitiUser := MemoMuitiUser + 'ユーザ個別ディレクトリ'; + MemoVirtualStore := MemoVirtualStore + '無効'; + end + else + begin + MemoMuitiUser := MemoMuitiUser + '実行ファイルと同一ディレクトリ'; + MemoVirtualStore := MemoVirtualStore + '有効'; + end; + + if IsVistaOrLater then + MemoVirtualStore := MemoVirtualStore + NewLine + NewLine + else + MemoVirtualStore := ''; + + Result := MemoDirInfo + NewLine + NewLine + + MemoMuitiUser + NewLine + NewLine + + MemoVirtualStore + + MemoComponentsInfo + NewLine + NewLine + + MemoGroupInfo + NewLine + NewLine + + MemoTasksInfo; +end; + + +{ ********************************** + Sample codes (not used at this moment + ********************************** } + +{ +Const + UAC_SUPPORT_LOWEST_VERSION_H = $00010005; 1.5. + UAC_SUPPORT_LOWEST_VERSION_L = $000f00c8; .15.200 + + if GetVersionNumbers( selectdir + 'sakura.exe', prev_version_h, prev_version_l ) then + begin + Result := False; + MsgBox( Format( 'existing version at %s : %d.%d.%d.%d', [ + selectdir + 'sakura.exe', + (prev_version_h shr 16 ), + (prev_version_h and $ffff ), + (prev_version_l shr 16 ), + (prev_version_l and $ffff )] ), + mbConfirmation, MB_OK); + if ( prev_version_h < UAC_SUPPORT_LOWEST_VERSION_H ) or + (( prev_version_h = UAC_SUPPORT_LOWEST_VERSION_H ) + and ( prev_version_l < UAC_SUPPORT_LOWEST_VERSION_L )) then + begin + end + end +} From b2943cb4dba3c9809aa9f9fe69302e0f9bbaf1fe Mon Sep 17 00:00:00 2001 From: Masaru Tsuchiyama Date: Sun, 24 Jun 2018 18:52:53 +0900 Subject: [PATCH 2/5] =?UTF-8?q?ArchitecturesInstallIn64BitMode,=20Architec?= =?UTF-8?q?turesAllowed=20=E3=82=92=E6=8C=87=E5=AE=9A=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - http://www.jrsoftware.org/ishelp/index.php?topic=setup_architecturesallowed - http://www.jrsoftware.org/ishelp/index.php?topic=setup_architecturesinstallin64bitmode --- installer/sakura-x64.iss | 3 +++ 1 file changed, 3 insertions(+) diff --git a/installer/sakura-x64.iss b/installer/sakura-x64.iss index 4a33220c04..c5e7568c85 100644 --- a/installer/sakura-x64.iss +++ b/installer/sakura-x64.iss @@ -5,8 +5,11 @@ #endif #define MyAppVer GetFileVersion("sakura\sakura.exe") #define MyAppVerH StringChange(MyAppVer, ".", "-") +#define MyArchitecture "x64" [Setup] +ArchitecturesInstallIn64BitMode={#MyArchitecture} +ArchitecturesAllowed={#MyArchitecture} AppName=サクラエディタ AppId=sakura editor AppVersion={#MyAppVer} From f7383c1aa07ecd745942440a812ae45e27b7b7f2 Mon Sep 17 00:00:00 2001 From: Masaru Tsuchiyama Date: Sun, 24 Jun 2018 18:57:37 +0900 Subject: [PATCH 3/5] =?UTF-8?q?=E5=87=BA=E5=8A=9B=E3=81=AE=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=82=B9=E3=83=88=E3=83=BC=E3=83=A9=E3=83=95=E3=82=A1?= =?UTF-8?q?=E3=82=A4=E3=83=AB=E5=90=8D=E3=81=AB=E3=82=A2=E3=83=BC=E3=82=AD?= =?UTF-8?q?=E3=83=86=E3=82=AF=E3=83=81=E3=83=A3=E5=90=8D=E3=82=92=E3=81=A4?= =?UTF-8?q?=E3=81=91=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- installer/sakura-x64.iss | 2 +- installer/sakura.iss | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/installer/sakura-x64.iss b/installer/sakura-x64.iss index c5e7568c85..a35d64104a 100644 --- a/installer/sakura-x64.iss +++ b/installer/sakura-x64.iss @@ -31,7 +31,7 @@ DisableStartupPrompt=no PrivilegesRequired=None ; エディタのバージョンに応じて書き換える場所 -OutputBaseFilename=sakura_install{#MyAppVerH} +OutputBaseFilename=sakura_install{#MyAppVerH}-{#MyArchitecture} VersionInfoVersion={#MyAppVer} VersionInfoProductVersion={#MyAppVer} diff --git a/installer/sakura.iss b/installer/sakura.iss index 4a33220c04..54665fa483 100644 --- a/installer/sakura.iss +++ b/installer/sakura.iss @@ -5,6 +5,7 @@ #endif #define MyAppVer GetFileVersion("sakura\sakura.exe") #define MyAppVerH StringChange(MyAppVer, ".", "-") +#define MyArchitecture "x86" [Setup] AppName=サクラエディタ @@ -28,7 +29,7 @@ DisableStartupPrompt=no PrivilegesRequired=None ; エディタのバージョンに応じて書き換える場所 -OutputBaseFilename=sakura_install{#MyAppVerH} +OutputBaseFilename=sakura_install{#MyAppVerH}-{#MyArchitecture} VersionInfoVersion={#MyAppVer} VersionInfoProductVersion={#MyAppVer} From 7da65bc6a672dfde511ea83fc817a48da874956f Mon Sep 17 00:00:00 2001 From: Masaru Tsuchiyama Date: Sun, 24 Jun 2018 18:59:58 +0900 Subject: [PATCH 4/5] =?UTF-8?q?x64=20=E7=89=88=E3=81=A8=20x86=20=E7=89=88?= =?UTF-8?q?=E3=81=A7=E4=BD=BF=E7=94=A8=E3=81=99=E3=82=8B=20iss=20=E3=83=95?= =?UTF-8?q?=E3=82=A1=E3=82=A4=E3=83=AB=E3=82=92=E5=88=87=E3=82=8A=E6=9B=BF?= =?UTF-8?q?=E3=81=88=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build-installer.bat | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build-installer.bat b/build-installer.bat index 593e20a379..5d42944bc3 100644 --- a/build-installer.bat +++ b/build-installer.bat @@ -39,7 +39,12 @@ 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) +set SAKURA_ISS=installer\sakura.iss +if "%platform%" == "x64" ( + set SAKURA_ISS=installer\sakura-x64.iss +) + +"C:\Program Files (x86)\Inno Setup 5\ISCC.exe" %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%" From cf44ff59b1885c89d840d75dbd0f5926d4177df8 Mon Sep 17 00:00:00 2001 From: Masaru Tsuchiyama Date: Sun, 24 Jun 2018 20:50:49 +0900 Subject: [PATCH 5/5] =?UTF-8?q?x86=20=E7=89=88=E3=81=A8=20x64=20=E7=89=88?= =?UTF-8?q?=E3=81=A7=20iss=20=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=82=92?= =?UTF-8?q?=E5=85=B1=E9=80=9A=E5=8C=96=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build-installer.bat | 6 +- installer/sakura-Win32.iss | 2 + installer/{sakura.iss => sakura-common.iss} | 5 +- installer/sakura-x64.iss | 362 +------------------- 4 files changed, 9 insertions(+), 366 deletions(-) create mode 100644 installer/sakura-Win32.iss rename installer/{sakura.iss => sakura-common.iss} (99%) diff --git a/build-installer.bat b/build-installer.bat index 5d42944bc3..a0207bbcb4 100644 --- a/build-installer.bat +++ b/build-installer.bat @@ -39,11 +39,7 @@ copy help\macro\macro.chm %INSTALLER_WORK%\ copy %platform%\%configuration%\*.exe %INSTALLER_WORK%\ copy %platform%\%configuration%\*.dll %INSTALLER_WORK%\ -set SAKURA_ISS=installer\sakura.iss -if "%platform%" == "x64" ( - set SAKURA_ISS=installer\sakura-x64.iss -) - +set SAKURA_ISS=installer\sakura-%platform%.iss "C:\Program Files (x86)\Inno Setup 5\ISCC.exe" %SAKURA_ISS% || (echo error && exit /b 1) if exist "%INSTALLER_RESOURCES%" rmdir /s /q "%INSTALLER_RESOURCES%" diff --git a/installer/sakura-Win32.iss b/installer/sakura-Win32.iss new file mode 100644 index 0000000000..a680cdf2f4 --- /dev/null +++ b/installer/sakura-Win32.iss @@ -0,0 +1,2 @@ +#define MyArchitecture "x86" +#include "sakura-common.iss" diff --git a/installer/sakura.iss b/installer/sakura-common.iss similarity index 99% rename from installer/sakura.iss rename to installer/sakura-common.iss index 54665fa483..4b473bc0b7 100644 --- a/installer/sakura.iss +++ b/installer/sakura-common.iss @@ -5,9 +5,12 @@ #endif #define MyAppVer GetFileVersion("sakura\sakura.exe") #define MyAppVerH StringChange(MyAppVer, ".", "-") -#define MyArchitecture "x86" [Setup] +#if MyArchitecture != "x86" +ArchitecturesInstallIn64BitMode={#MyArchitecture} +ArchitecturesAllowed={#MyArchitecture} +#endif AppName=サクラエディタ AppId=sakura editor AppVersion={#MyAppVer} diff --git a/installer/sakura-x64.iss b/installer/sakura-x64.iss index a35d64104a..3f481d9cbc 100644 --- a/installer/sakura-x64.iss +++ b/installer/sakura-x64.iss @@ -1,360 +1,2 @@ -#if VER < EncodeVer(5,6,1) - #define MySendTo "{sendto}" -#else - #define MySendTo "{usersendto}" -#endif -#define MyAppVer GetFileVersion("sakura\sakura.exe") -#define MyAppVerH StringChange(MyAppVer, ".", "-") -#define MyArchitecture "x64" - -[Setup] -ArchitecturesInstallIn64BitMode={#MyArchitecture} -ArchitecturesAllowed={#MyArchitecture} -AppName=サクラエディタ -AppId=sakura editor -AppVersion={#MyAppVer} -AppVerName=sakura editor(サクラエディタ) {#MyAppVer} -AppMutex=MutexSakuraEditor -AppPublisher=サクラエディタ開発チーム -AppPublisherURL=http://sakura-editor.sourceforge.net -AppSupportURL=http://sakura-editor.sourceforge.net -AppUpdatesURL=http://sourceforge.net/projects/sakura-editor/ -DefaultDirName={code:getDefautDirName|sakura} -DefaultGroupName=サクラエディタ -UninstallDisplayIcon={app}\sakura.exe -InfoBeforeFile="instmaterials\info.txt" - -WizardImageFile="instmaterials\SetupModern20.bmp" -WizardSmallImageFile="instmaterials\SetupModernSmall20.bmp" -DisableStartupPrompt=no - -PrivilegesRequired=None - -; エディタのバージョンに応じて書き換える場所 -OutputBaseFilename=sakura_install{#MyAppVerH}-{#MyArchitecture} -VersionInfoVersion={#MyAppVer} -VersionInfoProductVersion={#MyAppVer} - -; OSバージョン制限 -MinVersion=0,5.0 - -[Languages] -Name: "ja"; MessagesFile: "compiler:Languages\Japanese.isl" - -[Types] -Name: all; Description: "All" -Name: editorwithhelp; Description: "Editor with Help" -Name: editoronly; Description: "Editor Only" -Name: custom; Description: "カスタム"; Flags: iscustom - -[Components] -Name: main; Description: "サクラエディタ本体"; Types: all editorwithhelp editoronly custom; Flags: fixed -Name: help; Description: "ヘルプファイル"; Types: all editorwithhelp -Name: keyword; Description: "KeyWordファイル"; Types: all - -[Tasks] -Name: startmenu; Description: "スタートメニューを作成(&S)"; Components: main; -Name: quicklaunch; Description: "Quick Launchにアイコン作成(&Q)"; Components: main; -Name: proglist; Description: "プログラム一覧に追加(&P)"; Components: main; -Name: desktopicon; Description: "デスクトップにアイコン作成(&D)"; Components: main; Flags: unchecked; -Name: fileassoc; Description: "「SAKURAで開く」メニューの追加(&E)"; Components: main; Flags: unchecked; -Name: startup; Description: "起動時に常駐(&B)"; Components: main; Flags: unchecked; -Name: sendto; Description: "送るに追加(&T)"; Components: main; Flags: unchecked; - -[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; -Source: "sakura\sakura.exe.manifest.v";DestDir: "{app}"; Components: main; DestName: "sakura.exe.manifest"; Check: isMultiUserEnabled; Flags: onlyifdoesntexist; -Source: "sakura\sakura.chm"; DestDir: "{app}"; Components: help -Source: "sakura\macro.chm"; DestDir: "{app}"; Components: help -Source: "sakura\plugin.chm"; DestDir: "{app}"; Components: help -Source: "sakura\sakura.exe.ini"; DestDir: "{app}"; Components: main; Check: isMultiUserEnabled; Flags: onlyifdoesntexist; - -Source: "sakura\keyword\*"; DestDir: "{app}\keyword"; Components: keyword; Flags: recursesubdirs - -[Registry] -; registry for all user (Admin only) -Root: HKLM; Subkey: "SOFTWARE\Classes\*\shell\sakuraeditor"; ValueType: string; ValueName: ""; ValueData: "SAKURAで開く(&E)"; Tasks: fileassoc; Flags: uninsdeletekey; Check: CheckPrivilege(true) -Root: HKLM; Subkey: "SOFTWARE\Classes\*\shell\sakuraeditor\command"; ValueType: string; ValueName: ""; ValueData: """{app}\sakura.exe"" ""%1"""; Tasks: fileassoc; Flags: uninsdeletekey; Check: CheckPrivilege(true) -Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\sakura.exe\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\sakura.exe"" ""%1"""; Tasks: proglist; Flags: uninsdeletekey; Check: CheckPrivilege(true) - -; registry for each user (non-Admin only) -Root: HKCU; Subkey: "SOFTWARE\Classes\*\shell\sakuraeditor"; ValueType: string; ValueName: ""; ValueData: "SAKURAで開く(&E)"; Tasks: fileassoc; Flags: uninsdeletekey; Check: CheckPrivilege(false) -Root: HKCU; Subkey: "SOFTWARE\Classes\*\shell\sakuraeditor\command"; ValueType: string; ValueName: ""; ValueData: """{app}\sakura.exe"" ""%1"""; Tasks: fileassoc; Flags: uninsdeletekey; Check: CheckPrivilege(false) -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; 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; -Name: "{group}\アンインストール"; Filename: "{uninstallexe}"; Tasks: startmenu; -Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\サクラエディタ"; Filename: "{app}\sakura.exe"; Components: main; Tasks: quicklaunch; -Name: "{userstartup}\サクラエディタ常駐"; Filename: "{app}\sakura.exe"; Parameters: "-NOWIN"; Components: main; Tasks: startup; -Name: "{#MySendTo}\サクラエディタ"; Filename: "{app}\sakura.exe"; Components: main; Tasks: sendto; - -[Run] -FileName: "{app}\sakura.exe"; Description: "今すぐサクラエディタを起動"; WorkingDir: "{app}"; Flags: postinstall nowait skipifsilent; Check: CheckPrivilege(false); - -[UninstallDelete] -;Uninstall時に確認無く消されるのでコメントアウト -;Type: files; Name: "{app}\sakura.ini" - -[Dirs] -Name: "{userappdata}\sakura"; Components: main; Tasks: startmenu; Check: isMultiUserEnabled - -[Code] -var - MultiUserPage: TInputOptionWizardPage; - MultiUserPageEnabled : Boolean; - -{ ********************************** - Utility Functions - ********************************** } - -function isMultiUserEnabled : Boolean; -begin - Result := False; - if MultiUserPageEnabled then - Result := MultiUserPage.Values[0]; -end; - -function isMultiUserDisabled : Boolean; -begin - Result := not isMultiUserEnabled; -end; - -function CheckPrivilege( admin: Boolean ) : Boolean; -begin - if admin then - begin - Result := IsAdminLoggedOn; - end - else - begin - Result := not IsAdminLoggedOn; - end; -end; - -{ - default installation target directory - Admin: Program Files\sakura - User: \sakura -} -function getDefautDirName( progdir : String ) : String; -var - basedir : String; -begin - if IsAdminLoggedOn then - begin - basedir := ExpandConstant( '{pf}' ); - end - else - begin - basedir := ExpandConstant( '{userappdata}' ); - end; - Result := basedir + '\' + progdir; -end; - -function IsVistaOrLater : Boolean; -begin - Result := UsingWinNT and (( GetWindowsVersion shr 24) >= 6 ); -end; - -function IsWin2kOrLater : Boolean; -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 - ********************************** } - -{ Callback event functions } - -function NextButtonClickMultiUser( Sender : TWizardPage): Boolean; -var - selected: Integer; -{ t : String;} -begin - Result := True; - if MultiUserPageEnabled then - begin - -{ DEBUG CODE - t := 'MultiUser Setting :'; - if IsAdminLoggedOn then - t := t + 'Administrator '; - if ((GetWindowsVersion shr 24) >= 6 ) then - t := t + 'Vista '; - if MultiUserPage.Values[0] = False then - t := t + 'SingleUser '; - t := t + Format( 'WinVer: %.8x', [GetWindowsVersion] ); - MsgBox( t, mbConfirmation, MB_OK); -} - - { Alert if admin mode && multi user = False } - if IsAdminLoggedOn and - IsVistaOrLater and - ( MultiUserPage.Values[0] = False ) then - begin - selected := MsgBox( -{ 'Program Files等のシステムフォルダへインストールする場合はUACを無効にしないと設定が保存できませんがよろしいですか?',} - '互換モードでインストールします.システムファイルおよびプログラムをユーザ権限で編集すると編集結果が他のアプリケーションから参照できないことがあります.(VirtualStore機能)', - mbConfirmation, - ( MB_OKCANCEL )); - if selected = IDCANCEL then - Result := False; - end; - end; -end; - -function ShoudSkipMultiUser(Sender : TWizardPage ): Boolean; -var - selectdir : String; - prev_version_h, prev_version_l : Cardinal; -begin - Result := False; - if ( not MultiUserPageEnabled ) then - Result := True - else - begin - selectdir := AddBackslash(ExpandConstant( '{app}' )); - if FileExists( selectdir + 'sakura.exe' ) then - begin - Result := True; - if GetIniInt( 'Settings', 'MultiUser', 0, 0, 1, selectdir + 'sakura.exe.ini' ) = 1 then - MultiUserPage.Values[0] := True - else - MultiUserPage.Values[0] := False; - end; - end; -end; - -{ ********************************** - System Event Functions - ********************************** } - -{ Add multi user selection page if supported } -procedure InitializeWizard; -begin - { Create multi user page } - MultiUserPage := CreateInputOptionPage( wpSelectComponents, '設定保存方法の選択', - '設定をユーザ毎に保存するか実行ファイルの場所へ保存するかを選択してください', - 'よくわからない場合は変更しないでください', False, False ); - MultiUserPage.Add( '設定をユーザ毎に個別に管理する' ); - MultiUserPage.Values[0] := False; - MultiUserPage.OnShouldSkipPage := @ShoudSkipMultiUser; - MultiUserPage.OnNextButtonClick := @NextButtonClickMultiUser; - MultiUserPageEnabled := False; - {Show multiuser mode configuration only in case of Win2K or later } - if IsWin2kOrLater then - begin - { multi user mode is supported } - MultiUserPageEnabled := True; - - { - default multi user mode - User: OFF because installation target is also local - Admin: - Vista or later: ON - Other: OFF - } - if IsVistaOrLater and - IsAdminLoggedOn then - MultiUserPage.Values[0] := True - else - MultiUserPage.Values[0] := False; - end; -end; - -{ Build List of installation configuration for ready page } -function UpdateReadyMemo(Space, NewLine, MemoUserInfoInfo, MemoDirInfo, MemoTypeInfo, - MemoComponentsInfo, MemoGroupInfo, MemoTasksInfo: String): String; -var - MemoMuitiUser, MemoVirtualStore : String; -begin - MemoMuitiUser := '設定ファイル等格納場所' + NewLine + Space; - MemoVirtualStore := 'VirtualStore' + NewLine + Space; - - if isMultiUserEnabled then - begin - MemoMuitiUser := MemoMuitiUser + 'ユーザ個別ディレクトリ'; - MemoVirtualStore := MemoVirtualStore + '無効'; - end - else - begin - MemoMuitiUser := MemoMuitiUser + '実行ファイルと同一ディレクトリ'; - MemoVirtualStore := MemoVirtualStore + '有効'; - end; - - if IsVistaOrLater then - MemoVirtualStore := MemoVirtualStore + NewLine + NewLine - else - MemoVirtualStore := ''; - - Result := MemoDirInfo + NewLine + NewLine + - MemoMuitiUser + NewLine + NewLine + - MemoVirtualStore + - MemoComponentsInfo + NewLine + NewLine + - MemoGroupInfo + NewLine + NewLine + - MemoTasksInfo; -end; - - -{ ********************************** - Sample codes (not used at this moment - ********************************** } - -{ -Const - UAC_SUPPORT_LOWEST_VERSION_H = $00010005; 1.5. - UAC_SUPPORT_LOWEST_VERSION_L = $000f00c8; .15.200 - - if GetVersionNumbers( selectdir + 'sakura.exe', prev_version_h, prev_version_l ) then - begin - Result := False; - MsgBox( Format( 'existing version at %s : %d.%d.%d.%d', [ - selectdir + 'sakura.exe', - (prev_version_h shr 16 ), - (prev_version_h and $ffff ), - (prev_version_l shr 16 ), - (prev_version_l and $ffff )] ), - mbConfirmation, MB_OK); - if ( prev_version_h < UAC_SUPPORT_LOWEST_VERSION_H ) or - (( prev_version_h = UAC_SUPPORT_LOWEST_VERSION_H ) - and ( prev_version_l < UAC_SUPPORT_LOWEST_VERSION_L )) then - begin - end - end -} +#define MyArchitecture "x64" +#include "sakura-common.iss"