Skip to content

Commit 2b177e4

Browse files
committed
- Added NGEN optimization script
- Installer improvements
1 parent 1a25740 commit 2b177e4

File tree

4 files changed

+97
-5
lines changed

4 files changed

+97
-5
lines changed

CI/buildl.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,5 +107,5 @@ start FlashDevelop\Installer\Binary\FlashDevelop.exe
107107
exit
108108

109109
:error
110-
110+
pause
111111
exit -1

FlashDevelop/Bin/Debug/FDMT.cmd

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
:init
21
@echo off
32
cd /d %~dp0
43
echo FlashDevelop Maintenance Tool - v1.0.0
@@ -47,4 +46,3 @@ goto :menu
4746

4847
:end
4948
exit 0
50-

FlashDevelop/Bin/Debug/FDOPT.cmd

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
@echo off
2+
echo FlashDevelop OPtimizer Tool - v1.0.0
3+
echo.
4+
echo ! Make sure you have admin rights or run this as an admin !
5+
echo.
6+
7+
:: Set paths
8+
cd %~dp0%
9+
set CDIR=%~dp0%
10+
set PDIR=%~dp0%Plugins
11+
set NGEN=%WINDIR%\Microsoft.NET\Framework\v2.0.50727\ngen.exe
12+
13+
if "%1" == "install" goto :install
14+
if "%1" == "uninstall" goto :uninstall
15+
16+
:menu
17+
echo *** Available tasks ***
18+
echo.
19+
echo [1] Optimize with NGEN
20+
echo [2] Remove NGEN optimizations
21+
echo [3] Exit, I'm done.
22+
echo.
23+
set /p option="What do you want me to do? "
24+
if "%option%" == "1" goto :install
25+
if "%option%" == "2" goto :uninstall
26+
if "%option%" == "3" goto :end
27+
echo Invalid option, try again.
28+
echo.
29+
goto :menu
30+
31+
:install
32+
33+
echo Optimizing with NGEN...
34+
if exist "%CDIR%HaxeDevelop.exe" "%NGEN%" install "%CDIR%HaxeDevelop.exe" /AppBase:"%CDIR%\"
35+
if exist "%CDIR%FlashDevelop.exe" "%NGEN%" install "%CDIR%FlashDevelop.exe" /AppBase:"%CDIR%\"
36+
"%NGEN%" install "%CDIR%Aga.dll" /AppBase:"%CDIR%\"
37+
"%NGEN%" install "%CDIR%SwfOp.dll" /AppBase:"%CDIR%\"
38+
"%NGEN%" install "%CDIR%Antlr3.dll" /AppBase:"%CDIR%\"
39+
"%NGEN%" install "%CDIR%Scripting.dll" /AppBase:"%CDIR%\"
40+
"%NGEN%" install "%CDIR%Tools\fdbuild\fdbuild.exe" /AppBase:"%CDIR%Tools\fdbuild"
41+
"%NGEN%" install "%CDIR%Tools\asdocgen\ASDocGen.exe" /AppBase:"%CDIR%Tools\asdocgen"
42+
"%NGEN%" install "%CDIR%Tools\appman\AppMan.exe" /AppBase:"%CDIR%Tools\appman"
43+
:: Install plugins?
44+
:: for %%G in ("%PDIR%\*.dll") do "%NGEN%" install "%%G" /AppBase:"%CDIR%\"
45+
goto :end
46+
47+
:uninstall
48+
49+
echo Removing NGEN optimizations...
50+
if exist "%CDIR%HaxeDevelop.exe" "%NGEN%" uninstall "%CDIR%HaxeDevelop.exe"
51+
if exist "%CDIR%FlashDevelop.exe" "%NGEN%" uninstall "%CDIR%FlashDevelop.exe"
52+
"%NGEN%" uninstall "%CDIR%Aga.dll"
53+
"%NGEN%" uninstall "%CDIR%SwfOp.dll"
54+
"%NGEN%" uninstall "%CDIR%Antlr3.dll"
55+
"%NGEN%" uninstall "%CDIR%Scripting.dll"
56+
"%NGEN%" uninstall "%CDIR%Tools\fdbuild\fdbuild.exe"
57+
"%NGEN%" uninstall "%CDIR%Tools\asdocgen\ASDocGen.exe"
58+
"%NGEN%" uninstall "%CDIR%Tools\appman\AppMan.exe"
59+
:: Uninstall plugins?
60+
:: for %%G in ("%PDIR%\*.dll") do "%NGEN%" uninstall "%%G"
61+
goto :end
62+
63+
:end
64+
pause
65+
echo Done.
66+
exit 0

FlashDevelop/Installer/Installer.nsi

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,17 @@ Function GetIsWine
107107

108108
FunctionEnd
109109

110+
Function un.GetIsWine
111+
112+
Push $0
113+
ClearErrors
114+
EnumRegKey $0 HKLM "SOFTWARE\Wine" 0
115+
IfErrors 0 +2
116+
StrCpy $0 "not_found"
117+
Exch $0
118+
119+
FunctionEnd
120+
110121
Function GetDotNETVersion
111122

112123
Push $0
@@ -490,7 +501,14 @@ Section "Registry Modifications" RegistryMods
490501
WriteRegStr HKLM "Software\${DIST_NAME}" "CurrentVersion" ${VERSION}
491502
WriteRegStr HKLM "Software\${DIST_NAME}" "" $INSTDIR
492503
WriteUninstaller "$INSTDIR\Uninstall.exe"
493-
504+
505+
; Optimize with NGEN, not on CrossOver
506+
;Call GetIsWine
507+
;Pop $0
508+
;${If} $0 == "not_found"
509+
;nsExec::ExecToLog /TIMEOUT=1000 '"$INSTDIR\FDOPT.cmd" install'
510+
;${EndIf}
511+
494512
!insertmacro UPDATEFILEASSOC
495513

496514
SectionEnd
@@ -546,6 +564,13 @@ Section "un.${DIST_NAME}" UninstMain
546564
SectionIn 1 2 RO
547565
SetShellVarContext all
548566

567+
; Unoptimize with NGEN, not on CrossOver
568+
;Call un.GetIsWine
569+
;Pop $0
570+
;${If} $0 == "not_found"
571+
;nsExec::ExecToLog /TIMEOUT=1000 '"$INSTDIR\FDOPT.cmd" uninstall'
572+
;${EndIf}
573+
549574
Delete "$DESKTOP\${DIST_NAME}.lnk"
550575
Delete "$QUICKLAUNCH\${DIST_NAME}.lnk"
551576
Delete "$SMPROGRAMS\${DIST_NAME}\${DIST_NAME}.lnk"
@@ -568,6 +593,7 @@ Section "un.${DIST_NAME}" UninstMain
568593
RMDir /r "$INSTDIR\Templates"
569594

570595
Delete "$INSTDIR\FDMT.cmd"
596+
Delete "$INSTDIR\FDOPT.cmd"
571597
Delete "$INSTDIR\README.txt"
572598
Delete "$INSTDIR\FirstRun.fdb"
573599
Delete "$INSTDIR\Exceptions.log"
@@ -579,6 +605,8 @@ Section "un.${DIST_NAME}" UninstMain
579605
Delete "$INSTDIR\SciLexer.dll"
580606
Delete "$INSTDIR\SciLexer64.dll"
581607
Delete "$INSTDIR\Scripting.dll"
608+
Delete "$INSTDIR\AStyle64.dll"
609+
Delete "$INSTDIR\AStyle.dll"
582610
Delete "$INSTDIR\Antlr3.dll"
583611
Delete "$INSTDIR\SwfOp.dll"
584612
Delete "$INSTDIR\Aga.dll"
@@ -609,7 +637,7 @@ Section "un.${DIST_NAME}" UninstMain
609637
DeleteRegKey /ifempty HKCR "Applications\${DIST_NAME}.exe"
610638
DeleteRegKey /ifempty HKLM "Software\Classes\Applications\${DIST_NAME}.exe"
611639
DeleteRegKey /ifempty HKCU "Software\Classes\Applications\${DIST_NAME}.exe"
612-
640+
613641
!insertmacro UPDATEFILEASSOC
614642

615643
SectionEnd

0 commit comments

Comments
 (0)