ã¯ããã«
JDK 10ã¾ã§ã¯ãJavaFXã¢ããªã±ã¼ã·ã§ã³ãé å¸ããéã«ããã¤ãã£ãã»ã¤ã³ã¹ãã¼ã©ã¼å½¢å¼ã«ããjavapackageræ©è½ã使ã£ã¦OSåºæã®ã¤ã³ã¹ãã¼ã©ã¼ãä½æãããã¨ãã§ãã¾ãããWindowsãã¤ãã£ããªã¤ã³ã¹ãã¼ã©ã¼ãä½æããéã«ã¯ãå¤é¨ãã¼ã«ã¨ãã¦WiX Toolsetã使ã£ã¦MSIå½¢å¼ã®ã¤ã³ã¹ãã¼ã©ã¼ãä½æããããåããå¤é¨ãã¼ã«ã¨ãã¦InnoSetupã使ã£ã¦EXEå½¢å¼ã®ã¤ã³ã¹ãã¼ã©ã¼ãä½æãããã¨ãã§ãã¾ããã
ããããJDK 11ã§ã¯JavaFXã¨ã¨ãã«javapackageræ©è½ãåé¢ãããããJDK11ä¸ã§ã®JavaFXã¢ããªã±ã¼ã·ã§ã³ã¯ç¬èªã«ã¤ã³ã¹ãã¼ã©ã¼ãä½æãããã¨ã«ãªãã¾ãã
ä»åã¯ã次ã®JavaFXã¢ããªã±ã¼ã·ã§ã³ãWindows OSä¸ã¸ã¤ã³ã¹ãã¼ã«ããMSIå½¢å¼ã®ã¤ã³ã¹ãã¼ã©ã¼ãä½æãã¦ããã¾ããgitã®ãã©ã³ãã¯ãjdk11 ã¨ãªãã¾ããmasterã¯ãJDK 8çã®ã¾ã¾ã§ãã
ç°å¢
é ç® | å 容 |
---|---|
OS | Windows 10 64bit |
JDK | OpenJDK 11.0.1 |
ã¤ã³ã¹ãã¼ã©ã¼ä½æãã¼ã« | WiX Toolset 3.10 |
WiX Toolsetã®æ¦è¦ã¨ã¤ã³ã¹ãã¼ã«æ¹æ³ã¯ã次ã®Wikiãã¼ã¸ã«è¨è¼ãã¦ãã¾ãã
http://www.torutk.com/projects/swe/wiki/WiX
JavaFXã¢ããªã±ã¼ã·ã§ã³ã®å®è¡ã¤ã¡ã¼ã¸ä½æ
ã¤ã³ã¹ãã¼ã©ã¼ãä½æããåã«ãJavaFXã¢ããªã±ã¼ã·ã§ã³ã®å®è¡ã¤ã¡ã¼ã¸ãjlinkã³ãã³ãã使ã£ã¦ä½æãã¦ããã¾ãã
D:\work\AnalogClockGadget> jlink ^ --module-path "C:\Program Files\Java\JavaFX\javafx-jmods-11.0.1";build\modules ^ --add-modules com.torutk.gadget.analogclock ^ --launcher analogclock=com.torutk.gadget.analogclock/com.torutk.gadget.analogclock.AnalogClockApp ^ --compress=2 --no-header-files --output runtime D:\work\AnalogClockGadget> dir /w runtime [.] [..] [bin] [conf] [legal] [lib] release D:\work\AnalogClockGadget>
- JavaFXã©ã¤ãã©ãªï¼JMODã¢ã¸ã¥ã¼ã«ãã¡ã¤ã«ï¼ã¨ããã«ãããã¢ããªã±ã¼ã·ã§ã³ï¼ã¢ã¸ã¥ã¼ã«ï¼ã--module-pathãªãã·ã§ã³ã§æå®ãã¾ãã
- ã¢ã¸ã¥ã¼ã«ä¾åã®åºç¹ã¨ãªãJavaFXã¢ããªã±ã¼ã·ã§ã³ï¼ã¢ã¸ã¥ã¼ã«ï¼ã--add-modulesãªãã·ã§ã³ã§æå®ãã¾ãã
- JavaFXã¢ããªã±ã¼ã·ã§ã³å®è¡ç¨ã¹ã¯ãªããï¼ããããã¡ã¤ã«ãçæããããã--launcherãªãã·ã§ã³ã§ã¢ã¸ã¥ã¼ã«ã¨ã¨ã³ããªãã¤ã³ãã¯ã©ã¹åãæå®ãã¾ããããã§ã¯ã¹ã¯ãªããï¼ããããã¡ã¤ã«ã®å称ãanalogclockã¨ããã¢ã¸ã¥ã¼ã«åï¼ã¨ã³ããªãã¤ã³ãã¯ã©ã¹åãæå®ãã¾ãã
- çæããå®è¡ã¤ã¡ã¼ã¸ã®å¤§ãããå°ããããããã--compressãªãã·ã§ã³ã§ZIPå§ç¸®ï¼=2ï¼ãæå®ãã¾ãã
- å®è¡ã¤ã¡ã¼ã¸ã«ã¯JNIç¨ã®C/C++ãããã¼ãã¡ã¤ã«ãå«ã¾ãªããã--no-header-filesãªãã·ã§ã³ãæå®ãã¾ãã
çæãããruntimeãã£ã¬ã¯ããªã®bin\analogclock.bat ãå®è¡ããã¢ããªã±ã¼ã·ã§ã³ãèµ·åãããã¨ã確èªãã¾ãã
ã¤ã³ã¹ãã¼ã©ã¼ã®ä½æï¼ç¬¬ä¸æ©ï¼
WiX Toolsetã使ã£ã¦ãJavaFXã¢ããªã±ã¼ã·ã§ã³ã®ã¤ã³ã¹ãã¼ã©ã¼ãä½æãã¾ããã¾ãã¯ãæä½éã®æ©è½ã ããæã¤ã¤ã³ã¹ãã¼ã©ã¼ãä½æãã¾ãã
ã¤ã³ã¹ãã¼ã©ã¼ä½æã§ã¯ãWiXã®XMLææ¸ãè¨è¿°ãã¾ããä»åã¯ãã¤ã³ã¹ãã¼ã«ããå 容ãã¤ã³ã¹ãã¼ã«å ãã£ã¬ã¯ããªãå®ç¾©ããAnalogClock.wxsãã¡ã¤ã«ã¨ãã¤ã³ã¹ãã¼ã«ãããã¡ã¤ã«ç¾¤ãheatã³ãã³ãã§çæããruntime.wxsãã¡ã¤ã«ãç¨æãã¾ãã
WiXç¨XMLããã¥ã¡ã³ãï¼AnalogClock.wxsï¼
AnalogClock.wsxï¼å·¦ç«¯ã®â¼å°ãã¯ãªãã¯ããã¨å
容ã表示ï¼é表示ï¼
<?xml version="1.0" encoding="utf-8"?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"> <Product Id="*" Name="Analog Clock" Language="1041" Codepage="932" Version="0.4.1" Manufacturer="High Bridge" UpgradeCode="fe287b25-e03d-4744-90f4-96b05dc36bf0"> <Package Description="Analog Clock Gadget" Comments="(c) 2019 High Bridge" InstallerVersion="200" Compressed="yes" InstallScope="perMachine" /> <MajorUpgrade DowngradeErrorMessage="æ¢ã«æ°ãã [ProductName]ãã¤ã³ã¹ãã¼ã«ããã¦ãã¾ãã"/> <MediaTemplate EmbedCab="yes" /> <Directory Id="TARGETDIR" Name="SourceDir"> <Directory Id="ProgramFiles64Folder"> <Directory Id="CompanyFolder" Name="High Bridge"> <Directory Id="ApplicationFolder" Name="AnalogClock" /> </Directory> </Directory> </Directory> <Feature Id="Product" Title="Analog Clock" Level="1"> <ComponentGroupRef Id="RuntimeGroup" /> </Feature> </Product> </Wix>
Wixè¦ç´
WiXã®XMLææ¸æ§é ã¯ãæä¸ä½ã®è¦ç´ ãWixã§ãWixè¦ç´ ã®å±æ§ã§åå空éãæå®ãã¦ãã¾ãã
<?xml version="1.0" encoding="utf-8"?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"> : </Wix>
Productè¦ç´
Wixã®åè¦ç´ ã«Productè¦ç´ ãè¨è¿°ããã¢ããªã±ã¼ã·ã§ã³åãªã©ãå®ç¾©ãã¾ãã
<Product Id="*" Name="Analog Clock" Language="1041" Codepage="932" Version="0.4.1" Manufacturer="High Bridge" UpgradeCode="fe287b25-e03d-4744-90f4-96b05dc36bf0"> : </Product>
- Idå±æ§ã«ã¯GUIDãæå®ãã¾ããã"*"ãæå®ããã¨ã³ã³ãã¤ã«æã«GUIDãèªåçæããã¾ããã¤ã³ã¹ãã¼ã©ã¼ã¯ãã®GUIDãçããã¨åãããã°ã©ã ã¨èªèãã¾ããæ°ãããã¼ã¸ã§ã³ãªã©ã¤ã³ã¹ãã¼ã©ã¼ãä½ãç´ããéã¯ãã®GUIDãå¤æ´ããå¿ è¦ãããã¾ãã
- Nameå±æ§ã«ã¯ã¢ããªã±ã¼ã·ã§ã³åãå®ç¾©ãã¾ãã
- Versionå±æ§ã«ã¯ã¢ããªã±ã¼ã·ã§ã³ã®ãã¼ã¸ã§ã³çªå·ãå®ç¾©ãã¾ããé常ããªãªãã§åºåã£ã4ã¤ã®æ°å¤ãæå®ãã¾ãããã ãMSIã¤ã³ã¹ãã¼ã©ã¼ã¯ãã¼ã¸ã§ã³ã¢ããå¤å®æã«4ã¤ç®ã®æ°åãç¡è¦ãããã¨ã«çæãå¿ è¦ã§ãã
- Languageå±æ§ã¨Codepageå±æ§ã«ã¯ãã¤ã³ã¹ãã¼ã©ã¼ã使ç¨ãããã±ã¼ã«ã¨æåã³ã¼ããå®ç¾©ãã¾ããæ¥æ¬èªã®å ´åã¯ãLanguageå±æ§ã«1041ãCopdepageå±æ§ã«932ãæå®ãã¾ãã
- Manufacturerå±æ§ã«ã¯éçºå ã®çµç¹åã¾ãã¯éçºè åãå®ç¾©ãã¾ãã
- UpgradeCodeå±æ§ã«ã¯åãã¢ããªã±ã¼ã·ã§ã³ã§æ°ãããã¼ã¸ã§ã³ãæ´æ°ã¤ã³ã¹ãã¼ã«ããéã®èå¥ã«ä½¿ãGUIDãå®ç¾©ãã¾ãããã®GUIDã¯å¾ã æ°ãããã¼ã¸ã§ã³ã®ã¤ã³ã¹ãã¼ã©ã¼ãä½æããã¨ãã«ç¶ç¶ãã¦ä½¿ç¨ãã¾ããGUIDãçæããæ¹æ³ã«ã¤ãã¦ã¯ãWindowsデスクトップ環境でUUID(GUID)を生成する方法 - torutkのブログ ãã GUIDã®çæ ã«è¨è¼ãã¦ãã¾ãã
Packageè¦ç´
Productã®åè¦ç´ ã«Packageè¦ç´ ãè¨è¿°ãã¾ãã
<Package Description="Analog Clock Gadget" Comments="(c) 2019 High Bridge" InstallerVersion="200" Compressed="yes" InstallScope="perMachine"/>
- Descriptionå±æ§ã¨Commentså±æ§ã¯ãããã°ã©ã ã®èª¬æãã³ã¡ã³ããè¨è¼ãã¾ããã¤ã³ã¹ãã¼ã©ã¼ãã¡ã¤ã«ã®ããããã£ï¼è©³ç´°ï¼ã§èª¬æã«è¡¨ç¤ºããã¾ãã
- InstallerVersionå±æ§ã¯MSIã¤ã³ã¹ãã¼ã©ã¼ï¼msiexec.exeï¼ã®ãã¼ã¸ã§ã³ãæå®ãã¾ããMSIã®ãã¼ã¸ã§ã³ã«2.0ãæå®ããå ´åã"200"ã¨ãã¾ããç¾æç¹ã§ã¯4.5ãæå®ï¼"405"ï¼ãã¦ããããã¨æãã¾ããMSI 4.5ã¯ãWindows Vista SP2ãWindows Server 2008 SP2ã«æ¨æºæè¼ããã¦ãã¾ãã
- InstallScopeå±æ§ã¯ãå ¨ã¦ã®ã¦ã¼ã¶ã¼ã使ç¨ã§ããperMachineããã¤ã³ã¹ãã¼ã«ããã¦ã¼ã¶ã¼ã ãã使ç¨ã§ããperUserããæå®ãã¾ãã
Platformå±æ§ã¯ãã¤ã³ã¹ãã¼ã«ããããã±ã¼ã¸ã64bitç¨ã§ããã°x64ãæå®ãã¾ãããã®å±æ§ã§x64ãæå®ããã¨ãComponentè¦ç´ å ¨ã¦ã«Win64å±æ§ã®æå®ãå¿ è¦ã«ãªãã¾ããããã§ã64bitããã°ã©ã ãã¤ã³ã¹ãã¼ã«ããå ´åã¯ããã®å±æ§ã§ã¯ãªããcandleã³ãã³ãã®-archãªãã·ã§ã³ã§x64ãæå®ãã¾ãã
MajorUpgradeè¦ç´
æ°ãããã¼ã¸ã§ã³ã¸æ´æ°ããä»çµã¿ãå ¥ãã¾ãã
<MajorUpgrade DowngradeErrorMessage="æ¢ã«æ°ãã [ProductName]ãã¤ã³ã¹ãã¼ã«ããã¦ãã¾ãã"/>
DowngradeErrorMessageå±æ§ã«ã¯ãæ¢ã«ã¤ã³ã¹ãã¼ã«ããããã¼ã¸ã§ã³ããå¤ããã¼ã¸ã§ã³ãã¤ã³ã¹ãã¼ã«ãããã¨ããã¨ãã«ã¨ã©ã¼ã¡ãã»ã¼ã¸ã¨ãã¦è¡¨ç¤ºããå 容ãå®ç¾©ãã¾ãã
MediaTemplateè¦ç´
MSIãã¡ã¤ã«ã®ä¸ã«CABãã¡ã¤ã«ãå«ããå ´åã«æå®ãã¾ãï¼ãµã¤ãå«ããã®ã§ï¼ã
<MediaTemplate EmbedCab="yes" />
Directoryè¦ç´
ã¤ã³ã¹ãã¼ã©ã¼ã§ã¤ã³ã¹ãã¼ã«ããå ã®ãã£ã¬ã¯ããªæ§é ãå®ç¾©ãã¾ãã ä»åã¯ã次ã®ãã£ã¬ã¯ããªã«ã¤ã³ã¹ãã¼ã«ãããã®ã¨ãã¾ãã
C:\ +-- Program Filse +-- High Bridge +-- AnalogClock
ãã®ãã£ã¬ã¯ããªæ§é ã«å¯¾å¿ããDirectoryè¦ç´ ã®å®ç¾©ã¯æ¬¡ã¨ãªãã¾ãã
<Directory Id="TARGETDIR" Name="SourceDir"> <Directory Id="ProgramFiles64Folder"> <Directory Id="CompanyFolder" Name="High Bridge"> <Directory Id="ApplicationFolder" Name="AnalogClock" /> </Directory> </Directory> </Directory>
- ã«ã¼ããã£ã¬ã¯ããªï¼ãã©ã¤ãï¼ã¯ãIdå±æ§ã«TARGETDIRãæå®ãã¾ãã
- 64bitã¢ããªãã¤ã³ã¹ãã¼ã«ãããã·ã¹ãã å ±éã®ãã£ã¬ã¯ããªã¯ C:\Program Files ã§ãããããã¯äºåå®ç¾©åProgramFiles64FolderãIdå±æ§ã«æå®ãã¾ãã
- C:\Program Filesã®ä¸ã«ä½æãããã£ã¬ã¯ããªãæå®ãã¾ãã
Featureè¦ç´
<Feature Id="Product" Title="Analog Clock" Level="1"> <ComponentGroupRef Id="RuntimeGroup" /> </Feature>
Featureè¦ç´ ã§ã¯ã¤ã³ã¹ãã¼ã«ããå 容ãå®ç¾©ãã¾ããä»åã¯ãã¤ã³ã¹ãã¼ã«ãããã¡ã¤ã«ç¾¤ãWiX Toolsetã®heatã³ãã³ãã§èªåçæãããã®ã§ãheatã³ãã³ãã§ä½æããComponentGroupã®IdããComponentGroupRefã§åç §ããè¨è¿°ã¨ãã¾ãããªããComponentGroupã®Idã¯heatã³ãã³ãã®ãªãã·ã§ã³ã§æå®ãã¾ãã
WiX Toolsetã³ãã³ãã®å®è¡
heatã³ãã³ãã§runtimeãã£ã¬ã¯ããªä»¥ä¸ã®ãã¡ã¤ã«ç¾¤ããå®ç¾©ä½æ
D:\work\AnalogClockGadget> heat dir runtime ^ -srd -dr ApplicationFolder ^ -cg RuntimeGroup ^ -gg -g1 ^ -sfrag -sreg ^ -var "var.runtimeFolder" -o runtime.wxs
- 第1å¼æ°ã§åé対象ããã£ã¬ã¯ããªï¼dirï¼ã¨æå®ãã¾ãã
- -srdãªãã·ã§ã³ã§ã«ã¼ããã£ã¬ã¯ããªï¼ããã§ã¯dirãªãã·ã§ã³ã«ç¶ãã¦æå®ããruntimeãã£ã¬ã¯ããªï¼ã«å¯¾å¿ãããã£ã¬ã¯ããªã®çæãæå¶ãã¾ãããã®ãªãã·ã§ã³ãæå®ããªãã¨ãã¤ã³ã¹ãã¼ã«å ãã£ã¬ã¯ããªï¼C:\Program Files\High Bridge\AnalogClockï¼ã®ä¸ã«runtimeãã£ã¬ã¯ããªãä½æããããã®ä¸ã«binãã£ã¬ã¯ããªçãé ç½®ããã¾ãã -drãªãã·ã§ã³ã§ãã¤ã³ã¹ãã¼ã«å ãã£ã¬ã¯ããªã®Idãæå®ãã¾ããä»åã¯AnalogClock.wxs ã§AnalogClockããã°ã©ã ãã¤ã³ã¹ãã¼ã«ãããã£ã¬ã¯ããªã¨ãã¦å®ç¾©ããDirectoryè¦ç´ ã®Idã«æå®ããApplicationFolderãæå®ãã¦ãã¾ãã
- -cgãªãã·ã§ã³ã§ãçæããComonentGroupã®Idãæå®ãã¾ãããã®Idã¯ãAnalogClock.wxsã®Featureè¦ç´ ã®åè¦ç´ ComponentGroupRefã§åç §ãããã®ã§ä¸è´ãããå¿ è¦ãããã¾ãã
- -ggãªãã·ã§ã³ã§åComponentã®GUIDãçæããããæå®ãã¾ãã
- -ggãªãã·ã§ã³ã§GUIDãçæããéãæ³¢æ¬å¼§ãçç¥ããããæå®ãã¾ãã
- -sfragãªãã·ã§ã³ã§Fragmentè¦ç´ ãComponentè¦ç´ æ¯ã§ã¯ãªããComponentGroupè¦ç´ ã«ï¼ã¤çæããããæå®ãã¾ãã
- -sregãªãã·ã§ã³ã§ãDLLãã¡ã¤ã«ã«å¯¾ããã¬ã¸ã¹ããªæ å ±åéï¼COMã®DLLã§å¿ è¦ï¼ãæå¶ããããæå®ãã¾ãã64bit DLLã®ã¨ãã«HEAT5150è¦åãåºãã®ãæå¶ãã¾ãã
- -varãªãã·ã§ã³ã§ãFileè¦ç´ ã®Sourceå±æ§ã§æå®ãããã¹ã®åºç¹ã¨ãªããã©ã«ãããå¤æ°ã¨ãã¦çæããããæå®ãã¾ãããã®ãªãã·ã§ã³ãæå®ããªãã¨ãSourceDirã¨ããåºå®æååããã¹ã®åºç¹ã¨ãªããåå¨ããªãã®ã§å¾ã®lightã³ãã³ãå®è¡æã«ã¨ã©ã¼ã¨ãªãã¾ãã
- -oãªãã·ã§ã³ã§ãã£ã¬ã¯ããªä»¥ä¸ã®ãã¡ã¤ã«ç¾¤ãåéããæ å ±ãåãåºãWiXãã¡ã¤ã«åãæå®ãã¾ãã
candleã³ãã³ã
WiXææ¸ãã¡ã¤ã«ãcandleã³ãã³ãã§ã³ã³ãã¤ã«ããwixobjãã¡ã¤ã«ï¼ä¸éãã¡ã¤ã«ï¼ãçæãã¾ãã
D:\work\AnalogClockGadget> candle -arch x64 package\windows\AnalogClock.wxs D:\work\AnalogClockGadget> candle -arch x64 -druntimeFolder=runtime runtime.wxs
- 64bitãã¤ããªãã¤ã³ã¹ãã¼ã«ããå ´åã¯ã-archãªãã·ã§ã³ã§x64ãæå®ãã¾ãã
- -dãªãã·ã§ã³ã§ãheatã³ãã³ãã§ãFileè¦ç´ ã®Sourceå±æ§ã§ãã¡ã¤ã«ãã¹ã®åºç¹ãå¤æ°ã¨ãã¦çæããç®æã«å®éã®ãã¹ãè¨å®ãã¾ãã
å®è¡çµæãAnalogClock.wixobj 㨠runtime.wixobjãã¡ã¤ã«ãçæããã¾ãã
lightã³ãã³ã
Wixä¸éãã¡ã¤ã«ã§ããwixobjãã¡ã¤ã«ãããlightã³ãã³ãã§ã¤ã³ã¹ãã¼ã©ã¼ãã¡ã¤ã«ã«çæãã¾ãã
D:\work\AnalogClockGadget> light AnalogClock.wixobj runtime.wixobj -o analogclock.msi
- å¼æ°ã«ãcandleã³ãã³ãã§çæããwixobjãã¡ã¤ã«ï¼ä¸éãã¡ã¤ã«ï¼ããã¹ã¦æå®ãã¾ãã
- -oãªãã·ã§ã³ã§ä½æããMSIå½¢å¼ã¤ã³ã¹ãã¼ã©ã¼ã®ãã¡ã¤ã«åãæå®ãã¾ãã
å®è¡çµæãanalogclock.msiãã¡ã¤ã«ãçæããã¾ããã¡ãªã¿ã«ããã¡ã¤ã«ãµã¤ãºã¯38MBã§ããã
ã¤ã³ã¹ãã¼ã«
ãã®ç¬¬ä¸æ©ã®ã¤ã³ã¹ãã¼ã©ã¼ã¯ãå¿ è¦æå°éã®æ©è½ããè¨å®ãã¦ããªãã®ã§ãã¤ã³ã¹ãã¼ã©ã¼ãå®è¡ããã¨å¯¾è©±ï¼ãã¤ã¢ãã°ï¼ç»é¢ããªããæå®ã®ãã£ã¬ã¯ããªã«ã¤ã³ã¹ãã¼ã«ããã ãã¨ãªãã¾ããã¹ã¿ã¼ãã¡ãã¥ã¼ããã¹ã¯ãããã¸ã®ã·ã§ã¼ãã«ããç»é²ãããã¾ããã
analogclock.msiãå®è¡ããã¨ã次ã®ããã«çµéã表示ããç»é¢ãåºã¦ããã«çµäºãã¾ãã
ããã°ã©ã ãå®è¡ããã«ã¯ãã¤ã³ã¹ãã¼ã«å ã®C:\Program Files\High Bridge\AnalogClock\bin\analogclock.batãå®è¡ãã¾ãã
ã¤ã³ã¹ãã¼ã©ã¼ã®ä½æï¼ç¬¬äºæ©ï¼
第ä¸æ©ã§ä½æããã¤ã³ã¹ãã¼ã©ã¼ã¯ãæå®ã®ãã£ã¬ã¯ããªã¸ããã°ã©ã ãã¤ã³ã¹ãã¼ã«ããã ãã®ãã®ã§ããã 次ã¯ãã¹ã¿ã¼ãã¡ãã¥ã¼ã®ããã°ã©ã ä¸è¦§ã«ã¤ã³ã¹ãã¼ã«ããJavaFXã¢ããªã±ã¼ã·ã§ã³ãèµ·åããã·ã§ã¼ãã«ããã追å ããæ©è½ãçãè¾¼ã¿ã¾ãã
Directoryè¦ç´ ã«ã¹ã¿ã¼ãã¡ãã¥ã¼ï¼ããã°ã©ã ã¡ãã¥ã¼ï¼ã¨ãµããã©ã«ãå®ç¾©ã追å
<Directory Id="ApplicationFolder" Name="AnalogClock" /> </Directory> </Directory> + <Directory Id="ProgramMenuFolder"> + <Directory Id="ApplicationProgramsFolder" Name="High Bridge" /> + </Directory> </Directory>
Directoryã®ã«ã¼ãè¦ç´ ã®åè¦ç´ ã«ãIdå±æ§ã§ProgramMenuFolderãæå®ããDirectoryè¦ç´ ã追å ãã¾ããProgramMenuFolderã¯äºåå®ç¾©åã§ãå ¨ã¦ã¼ã¶ã¼ç¨ã®ã¹ã¿ã¼ãã¡ãã¥ã¼ã®ããã°ã©ã ãã£ã¬ã¯ããªã示ãã¾ããï¼C:\ProgramData\Microsoft\Windows\Start Menu\Programsï¼
ããã¦ããã®ä¸ã«ã¢ããªã±ã¼ã·ã§ã³ã®ã·ã§ã¼ãã«ãããå容ãããµããã©ã«ãã®Directoryè¦ç´ ã追å ãã¾ããä»»æã®Idå±æ§ã¨ä½æãããã©ã«ãåãNameå±æ§ã«æå®ãã¾ãã
ã·ã§ã¼ãã«ããè¦ç´ ãå®ç¾©
ããã°ã©ã ãå®è¡ããã·ã§ã¼ãã«ãããå®ç¾©ãã¾ãã DirectoryRefè¦ç´ ã§ã·ã§ã¼ãã«ãããä½æãããã©ã«ããæå®ãããã®åè¦ç´ ã«Componentè¦ç´ ã§å²ã£ã¦Shortcutè¦ç´ ãå®ç¾©ãã¾ããã¾ããã¢ã³ã¤ã³ã¹ãã¼ã«ç¨ã®RemoveFolderè¦ç´ ãShortcutè¦ç´ ã®KeyPath代æ¿ã¨ãã¦RegistryValueè¦ç´ ãå®ç¾©ãã¾ãã
<DirectoryRef Id="ApplicationProgramsFolder"> <Component Id="ApplicationShortcut" Guid="*"> <Shortcut Id="ApplicationStartMenuShortcut" Icon="java.exe" Name="Analog Clock Gadget" Show="minimized" Target="[ApplicationFolder]\bin\analogclock.bat" WorkingDirectory="ApplicationFolder"/> <RemoveFolder Id="CleanUpShortcut" Directory="ApplicationProgramsFolder" On="uninstall" /> <RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]" Name="installed" Type="integer" Value="1" KeyPath="yes"/> </Component> </DirectoryRef> <Icon Id="java.exe" SourceFile="runtime\bin\java.exe" />
- DirectoryRefè¦ç´ ã®Idå±æ§ã¯ãå ã«å®ç¾©ããã·ã§ã¼ãã«ãããå容ãããã©ã«ãã®Idå±æ§ãåç §
- Comonentè¦ç´ ã®Idå±æ§ã¯ãå¾ã§Featureè¦ç´ ã®åè¦ç´ ã«è¿½å ããComponentRefã§åç §ããååãæå®
- Shortcutè¦ç´
- Iconå±æ§ã§ã·ã§ã¼ãã«ããã®ã¢ã¤ã³ã³ãæå®ï¼ã¢ã¤ã³ã³ããªã½ã¼ã¹ã«æã¤exeãã¡ã¤ã«çãæå®å¯è½ï¼ãiconè¦ç´ ã®Idå±æ§ãåç §ãã¾ãã
- Nameå±æ§ã¯ã¹ã¿ã¼ãã¡ãã¥ã¼ã«è¡¨ç¤ºãããã·ã§ã¼ãã«ããåã¨ãªãã®ã§ããããããååãæå®
- Showå±æ§ã¯ãããããã¡ã¤ã«ã®ã·ã§ã¼ãã«ãããä½æããå ´åã«å®è¡æã«ã³ãã³ãããã³ããã表示ãããã®ãæå¶ããããminimizedãæå®
- Targetå±æ§ã¯ã·ã§ã¼ãã«ããã®å¯¾è±¡ãã¡ã¤ã«ãæå®ãDirectoryè¦ç´ ã®Idã§å®ç¾©ããååãå©ç¨ãããã¨ãã§ãã
- WorkingDirectoryå±æ§ã§ã·ã§ã¼ãã«ããå®è¡æã®ã«ã¬ã³ããã£ã¬ã¯ããªãæå®
- RemoveFolderè¦ç´ ã¯ãã¢ã³ã¤ã³ã¹ãã¼ã«æã«ã·ã§ã¼ãã«ãããã©ã«ããåé¤ããããã®å®ç¾©ããã¦ãã¾ãã
- RegistryValueè¦ç´ ã¯ãShortcutè¦ç´ ãKeyPathå±æ§ãæã¦ãªãå¶ç´ã解決ããããã«ãã¬ã¸ã¹ããªã使ç¨ãã¾ãã
- Iconè¦ç´ ã¯ãShortcutè¦ç´ ã®Iconå±æ§ããåç §ãããã·ã§ã¼ãã«ããã®ã¢ã¤ã³ã³ãè¦å®ãã¾ããIdã¯å¯¾è±¡ãã¡ã¤ã«ã¨åãæ¡å¼µåãæã¤å¿ è¦ãããã¾ãã
Featureè¦ç´ ã«è¿½å
<Feature Id="Product" Title="Analog Clock" Level="1">
<ComponentGroupRef Id="RuntimeGroup" />
+ <ComponentRef Id="ApplicationShortcut" />
</Feature>
- Featureè¦ç´ ã®åè¦ç´ ã«ãå ã»ã©ã·ã§ã¼ãã«ããå®ç¾©ã§ä½æããComonentè¦ç´ ã®Idãåç §ããComponentRefè¦ç´ ã追å ãã¾ãã
ã¤ã³ã¹ãã¼ã«ããã¨ã¹ã¿ã¼ãã¡ãã¥ã¼ã«ã·ã§ã¼ãã«ãããçæ
ã¤ã³ã¹ãã¼ã©ã¼ã®ä½æï¼ç¬¬ä¸æ©ï¼
第ä¸æ©ã第äºæ©ã§ä½æããã¤ã³ã¹ãã¼ã©ã¼ã¯ãã¤ã³ã¹ãã¼ã«ãå®è¡ããã¨ä¸ç¬ãã¤ã¢ãã°ã表示ããã¾ããããã«æ¶ãã¦ã¤ã³ã¹ãã¼ã«ãå®äºãã¦ãã¾ãã¾ãã
ããã§ãæ®éã®ã¤ã³ã¹ãã¼ã©ã¼ã®ããã«ãã¤ã³ã¹ãã¼ã«ç»é¢ã表示ããã¦ã¼ã¶ã¼ãæä½ããã¨ã¤ã³ã¹ãã¼ã«ãé²ãããã«ãã¾ãã
WiXã§ã¯ããä»çãã®å¯¾è©±ãã¤ã¢ãã°ãããã¤ãç¨æããã¦ããã®ã§ããã®ä¸ãããã¼ãºã«åããã®ãé¸æãããã¨ãã§ãã¾ãããã«ã¹ã¿ã ã®å¯¾è©±ãã¤ã¢ãã°ãä½ããã¨ãã§ãã¾ããä»å第ä¸æ©ã§ã¯ããä»çãã®å¯¾è©±ãã¤ã¢ãã°ããæå°éã®å¯¾è©±ãè¡ãWixUI_Minimalã使ç¨ãã¾ãããã®WixUI_Minimalã¯ãã¤ã³ã¹ãã¼ã«æã«ã©ã¤ã»ã³ã¹è¡¨ç¤ºãè¡ããã¦ã¼ã¶ã¼ã確èªãããã¨ã¤ã³ã¹ãã¼ã«ãéå§ããã¾ãã
WiXå®ç¾©ã«UIã追å
</Feature> + + <UIRef Id="WixUI_Minimal" /> + <WixVariable Id="WixUILicenseRtf" Value="License.rtf" /> + </Product>
Productè¦ç´ ã®åè¦ç´ ã«UIRefè¦ç´ ã追å ããIdå±æ§ã«äºåå®ç¾©æ¸ã¿WixUI_Minimalãæå®ãã¾ãã
åãããProductè¦ç´ ã®åè¦ç´ ã«WixVariableè¦ç´ ã追å ããIdå±æ§ã«äºåå®ç¾©æ¸ã¿WixUILicenseRtfãæå®ãValueå±æ§ã«RTFï¼Rich Text Formatï¼å½¢å¼ã§ç¨æããã©ã¤ã»ã³ã¹è¨±è«¾ãã¡ã¤ã«ãæå®ãã¾ããã¢ããªã±ã¼ã·ã§ã³ã®ã©ã¤ã»ã³ã¹ãè¨è¿°ãããã¡ã¤ã«ãRTFå½¢å¼ã§ä¿åãã¾ããRTFå½¢å¼ã¯ãWindowsæ¨æºãã¼ã«ã®Wordpadã§ä½æå¯è½ã§ãã
lightã³ãã³ãã®ãªãã·ã§ã³è¿½å
- light AnalogClock.wixobj runtime.wixobj -o analogclock.msi + light AnalogClock.wixobj runtime.wixobj -o analogclock.msi -ext WixUIExtension
ã¤ã³ã¹ãã¼ã«å®æ½
MSIå½¢å¼ã®ã¤ã³ã¹ãã¼ã©ã¼ãã¡ã¤ã«ï¼ç¬¬ä¸æ©çï¼ãå®è¡ããã¨ãã©ã¤ã»ã³ã¹ç»é¢ã表示ããã¾ãã
ã©ã¤ã»ã³ã¹ãæ¿è«¾ããã¨ãã¤ã³ã¹ãã¼ã«ãéå§ãã¾ãã
ã¤ã³ã¹ãã¼ã«ãå®äºããã¨ãã¤ã³ã¹ãã¼ã«å®äºç»é¢ã表示ããã¾ãã
ã¤ã³ã¹ãã¼ã©ã¼ã®ä½æï¼ç¬¬åæ©ï¼
ãåã¾ã§ã®æ®µéã§ã¯ãã¤ã³ã¹ãã¼ã«å ãåºå®ã¨ãªã£ã¦ãã¾ããä»åã¯ãã¤ã³ã¹ãã¼ã«å ãå¤æ´ãããã¤ã¢ãã°ã追å ãã¾ãã
WiXå®ç¾©ãå¤æ´ï¼åé¡ããï¼
第ä¸æ©ã§è¿½å ãã対話ãã¤ã¢ãã°ç¨®é¡ã¯ãã©ã¤ã»ã³ã¹è¡¨ç¤ºã¨ã¤ã³ã¹ãã¼ã«çµæ表示ãæã¤WixUI_Minimalã§ãããããããã¤ã³ã¹ãã¼ã«å å¤æ´è¡¨ç¤ºãæã¤WixUI_InstallDirã«å¤æ´ãã¾ãã ãã®WixUI_InstallDirã使ãã¨ãã¯ãã¢ããªã±ã¼ã·ã§ã³ãã¤ã³ã¹ãã¼ã«ãããã£ã¬ã¯ããªãå®ç¾©ããDirectoryè¦ç´ ã®Idããããããã£WIXUI_INSTALLDIRã«æå®ããå¿ è¦ãããã¾ãã
</Feature> - <UIRef Id="WixUI_Minimal" /> + <Property Id="WIXUI_INSTALLDIR" Value="ApplicationFolder" /> + <UIRef Id="WixUI_InstallDir" /> <WixVariable Id="WixUILicenseRtf" Value="License.rtf" />
ã¤ã³ã¹ãã¼ã«å®æ½ï¼åé¡ããï¼
ã¤ã³ã¹ãã¼ã«ãå®æ½ããã¨æ¬¡ã®ç»é¢ã表示ããã¾ãã
ã©ã¤ã»ã³ã¹è¡¨ç¤ºç»é¢ã表示ããã¾ãã
ããã©ã«ãã®ã¤ã³ã¹ãã¼ã«å ã表示ããã¾ãã
[Change]ãã¿ã³ãæ¼ãã¨ããã£ã¬ã¯ããªé¸æç»é¢ã表示ããã¾ãã
ã¤ã³ã¹ãã¼ã«æºåå®äºã®ç»é¢ã表示ããã¾ãã
ã¤ã³ã¹ãã¼ã«ã®çµéã示ãç»é¢ã表示ããã¾ãã
ã¤ã³ã¹ãã¼ã«ãå®äºããç»é¢ã表示ããã¾ãã
åé¡ã¨ã¯ï¼
ã¤ã³ã¹ãã¼ã©ã¼ã§ã¤ã³ã¹ãã¼ã«å ãå¤æ´ããã«ãé¢ããããã¤ã³ã¹ãã¼ã«å ã¯ããã©ã«ãã®ãã£ã¬ã¯ããªã¨ãªã£ã¦ãã¾ãã¾ããã
ãããã調ã¹ã¦ã¿ãã¨ãããWIXUI_INSTALLDIRããããã£ã§æå®ãããã£ã¬ã¯ããªã®Idã®ååã¯ãã¹ã¦å¤§æåã¨ããå¿ è¦ãããã¨ãããã¨ãå¤æãã¾ããã
WiXå®ç¾©ãå¤æ´ï¼åé¡è§£æ±ºï¼
AnalogClock.wxsã®å¤æ´ç®æ
<Directory Id="TARGETDIR" Name="SourceDir"> <Directory Id="ProgramFiles64Folder"> <Directory Id="CompanyFolder" Name="High Bridge"> - <Directory Id="ApplicationFolder" Name="AnalogClock" /> + <Directory Id="APPLICATIONFOLDER" Name="AnalogClock" /> </Directory> </Directory>
Show="minimized" - Target="[ApplicationFolder]\bin\analogclock.bat" - WorkingDirectory="ApplicationFolder"/> + Target="[APPLICATIONFOLDER]\bin\analogclock.bat" + WorkingDirectory="APPLICATIONFOLDER"/> <RemoveFolder Id="CleanUpShortcut"
<UIRef Id="WixUI_InstallDir" />
+ <Property Id="WIXUI_INSTALLDIR" Value="APPLICATIONFOLDER" />
<WixVariable Id="WixUILicenseRtf" Value="License.rtf" />
heatã³ãã³ãå®è¡ãªãã·ã§ã³ã®å¤æ´
D:\work\AnalogClockGadget> heat dir runtime ^ - -srd -dr ApplicationFolder ^ + -srd -dr APPLICATIONFOLDER ^ -cg RuntimeGroup ^ -gg -g1 ^ -sfrag -sreg ^ -var "var.runtimeFolder" -o runtime.wxs
ã¤ã³ã¹ãã¼ã«å®æ½ï¼åé¡è§£æ±ºï¼
ã¤ã³ã¹ãã¼ã©ã¼ã®ç»é¢ã«å¤æ´ã¯ããã¾ããããã¤ã³ã¹ãã¼ã«å ãç¡äºå¤æ´ã§ããããã«ãªãã¾ããã
jlinkã§çæããã©ã³ãã£ã¼ï¼ããããã¡ã¤ã«ï¼ã®ä¿®æ£
jlink ã§--launcherãªãã·ã§ã³ãæå®ããã¨ã次ã®ããããã¡ã¤ã«ãçæããã¾ãã
@echo off set JLINK_VM_OPTIONS= set DIR=%~dp0 "%DIR%\java" %JLINK_VM_OPTIONS% -m com.torutk.gadget.analogclock/com.torutk.gadget.calendar.AnalogClockApp %*
ãã®ããããã¡ã¤ã«ã«2ã¤ã®ä¿®æ£ãå ãã¾ãã
- å®è¡æã«ã³ãã³ãããã³ããã表示ãããã¾ã¾ã¨ãªããªãããèµ·åã³ãã³ããjava.exeããjavaw.exeã«å¤æ´
- CPUã»ã¡ã¢ãªã«ããããããã»ã¹ã¨ããã¹ãã³ãã³ãã©ã¤ã³ãªãã·ã§ã³ã追å
èµ·åã³ãã³ããjava.exeããjavaw.exeã«å¤æ´
javaã³ãã³ãã¯ã³ã³ã½ã¼ã«ï¼ã³ãã³ãããã³ããï¼ãä¼´ãã®ã§ããã®ã©ã³ãã£ã¼ï¼ããããã¡ã¤ã«ï¼ãå®è¡ããã¨ç»é¢ã«ã³ãã³ãããã³ããã表示ãããã¾ã¾ã¨ãªãã¾ããã·ã§ã¼ãã«ããã§ã³ãã³ãããã³ãããæå°åããè¨å®ããã¦ãã¾ãããã¿ã¹ã¯ãã¼ã«ã¯ã³ãã³ãããã³ãããæ®ã£ãã¾ã¾ã¨ãªãã¾ãã
ããã§ãããããã¡ã¤ã«ã®ä¸ã§javaã³ãã³ããjavawã³ãã³ãã«ä¿®æ£ããã³ãã³ãããã³ãããæ®ããªãããã«ãã¾ãã
@echo off set JLINK_VM_OPTIONS= set DIR=%~dp0 - "%DIR%\java" %JLINK_VM_OPTIONS% -m com.torutk.gadget.analogclock/com.torutk.gadget.calendar.AnalogClockApp %* + start "" /b "%DIR%\javaw" %JLINK_VM_OPTIONS% -m com.torutk.gadget.analogclock/com.torutk.gadget.calendar.AnalogClockApp %*
- startã³ãã³ãã§javawã³ãã³ããèµ·åãã¾ããæåã®""ããªãã¨ãstartã³ãã³ãã"%DIR%javaw" ãã¦ã£ã³ãã¦ã¿ã¤ãã«ã¨ãã¦æ±ããã¨ã©ã¼ã¨ãªãã¾ãã
CPUã»ã¡ã¢ãªã«ããããã³ãã³ãã©ã¤ã³ãªãã·ã§ã³ã追å
64bitçã®javaï¼javawï¼ã³ãã³ãã¯ããã©ã«ãã§ã¯CPUãã¡ã¢ãªããããã使ãè¨å®ã¨ãªã£ã¦ãã¾ãã ããã§ãå¿ è¦æä½éã®CPUã¨ã¡ã¢ãªä½¿ç¨ã«ãã¹ããJavaVMãªãã·ã§ã³ã追å æå®ãã¾ãã
@echo off - set JLINK_VM_OPTIONS= + set JLINK_VM_OPTIONS=-Xms32m -Xmx64m -Xss256k ^ + -XX:TieredStopAtLevel=1 -XX:CICompilerCount=2 -XX:CompileThreshold=1500 ^ + -XX:InitialCodeCacheSize=160k -XX:ReservedCodeCacheSize=32m ^ + -XX:MetaspaceSize=12m -XX:+UseSerialGC set DIR=%~dp0 start "" /b "%DIR%\javaw" %JLINK_VM_OPTIONS% ^ -m com.torutk.gadget.analogclock/com.torutk.gadget.analogclock.AnalogClockApp
ãªãã·ã§ã³ã®æå³ã»å¤ãªã©ã¯æ¬¡ã«ç°¡åãªã¾ã¨ãè¨è¼ JDK 9 JavaVMオプション - ソフトウェアエンジニアリング - Torutk
ã¾ã¨ã
JavaFXã¢ããªã±ã¼ã·ã§ã³ãJDK11ï¼ã¢ã¸ã¥ã¼ã«ï¼JPMSï¼å¯¾å¿ããå¾ã«ãWindowsã¤ã³ã¹ãã¼ã©ã¼ãä½ã£ã¦Javaå®è¡ç°å¢ãå«ãã¦é å¸ã§ããããã«ãã¾ããã
- ä½æ¥ç°å¢ã¯ãWindows 10ãOpenJDK 11.0.1ãOpenJFX 11.0.1ãWiX Toolset 3.10
- jlink ã³ãã³ãã§ãJavaFXã¢ããªã±ã¼ã·ã§ã³ã¨ãã®å®è¡ã«å¿ è¦ãªã¢ã¸ã¥ã¼ã«ãæ½åºãã¦å®è¡ç°å¢ã®ã¤ã¡ã¼ã¸ãä½æ
- WiX Toolset ã§å®è¡ç°å¢ã®ã¤ã¡ã¼ã¸ããMSIå½¢å¼ã¤ã³ã¹ãã¼ã©ã¼ãä½æ
- AnalogClock.wxs ãã¡ã¤ã«ï¼XMLããã¥ã¡ã³ãï¼ãè¨è¿°ããã¢ããªã±ã¼ã·ã§ã³ã®æ å ±ãã¤ã³ã¹ãã¼ã«å ãã£ã¬ã¯ããªãã¹ã¿ã¼ãã¡ãã¥ã¼ã®ã·ã§ã¼ãã«ãããã¤ã³ã¹ãã¼ã©ã¼ã®GUI種é¡ãªã©ãå®ç¾©
- heatã³ãã³ãã§jlinkãçæããå®è¡ç°å¢ã®ãã£ã¬ã¯ããªã»ãã¡ã¤ã«æ å ±ãåéã runtime.wxsãã¡ã¤ã«ï¼XMLããã¥ã¡ã³ãï¼ãçæ
- candleã³ãã³ãã§ã2ã¤ã®WiX XMLããã¥ã¡ã³ãï¼AnalogClock.wxsãruntime.wxsï¼ãã³ã³ãã¤ã«
- lightã³ãã³ãã§ãMSIå½¢å¼ã¤ã³ã¹ãã¼ã©ã¼ãçæ
- ã©ã³ãã£ã¼ï¼ããããã¡ã¤ã«ï¼ã«ãªãã·ã§ã³è¿½è¨
MSIã¤ã³ã¹ãã¼ã©ã¼ã®ãµã¤ãºã¯ç´38MBãã¤ã³ã¹ãã¼ã«å¾ã®ãµã¤ãºã¯ç´52MBã¨ãªãã¾ããã