Skip to content

Commit

Permalink
Add Rainmeter.exe.config to declare support for the .NET 4.0 and 4.5 …
Browse files Browse the repository at this point in the history
…runtimes

This allows plugins like InputText.dll to be used with .NET 4.0/4.5 in addition to 2.0. Therefore, we can avoid installing .NET 2.0 on Windows 8 and 8.1 where it is not installed by default (whereas 4.5/4.5.1 is installed by default).
  • Loading branch information
poiru committed Oct 18, 2013
1 parent 1940b7f commit f6461a1
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 21 deletions.
5 changes: 5 additions & 0 deletions Application/Application.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ xcopy /Q /S /Y ..\Build\Themes ..\testbench\x64\release\Layouts
<ItemGroup>
<ResourceCompile Include="Application.rc" />
</ItemGroup>
<ItemGroup>
<Content Include="Rainmeter.exe.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<None Include="Rainmeter.ico" />
</ItemGroup>
Expand Down
9 changes: 9 additions & 0 deletions Application/Rainmeter.exe.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.5.1" />
<supportedRuntime version="v4.5" />
<supportedRuntime version="v4.0" />
<supportedRuntime version="v2.0.50727" />
</startup>
</configuration>
45 changes: 24 additions & 21 deletions Build/Installer/Installer.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -619,31 +619,33 @@ Section
${EndIf}
${EndIf}

; Download and install .NET if required
ReadRegDWORD $0 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v2.0.50727" "Install"
${If} $0 <> 1
${If} $Install64Bit <> 1
NSISdl::download /TIMEOUT=30000 "http://download.microsoft.com/download/5/6/7/567758a3-759e-473e-bf8f-52154438565a/dotnetfx.exe" "$PLUGINSDIR\dotnetfx.exe"
${Else}
NSISdl::download /TIMEOUT=30000 "http://download.microsoft.com/download/a/3/f/a3f1bf98-18f3-4036-9b68-8e6de530ce0a/NetFx64.exe" "$PLUGINSDIR\dotnetfx.exe"
${EndIf}
Pop $0
${IfNot} ${AtLeastWinVista}
; Download and install .NET if required
ReadRegDWORD $0 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v2.0.50727" "Install"
${If} $0 <> 1
${If} $Install64Bit <> 1
NSISdl::download /TIMEOUT=30000 "http://download.microsoft.com/download/5/6/7/567758a3-759e-473e-bf8f-52154438565a/dotnetfx.exe" "$PLUGINSDIR\dotnetfx.exe"
${Else}
NSISdl::download /TIMEOUT=30000 "http://download.microsoft.com/download/a/3/f/a3f1bf98-18f3-4036-9b68-8e6de530ce0a/NetFx64.exe" "$PLUGINSDIR\dotnetfx.exe"
${EndIf}
Pop $0

${If} $0 == "success"
ExecWait '"$PLUGINSDIR\dotnetfx.exe" /q:a /c:"install /q"' $0
Delete "$PLUGINSDIR\dotnetfx.exe"
${If} $0 == "success"
ExecWait '"$PLUGINSDIR\dotnetfx.exe" /q:a /c:"install /q"' $0
Delete "$PLUGINSDIR\dotnetfx.exe"

${If} $0 = 3010
SetRebootFlag true
${ElseIf} $0 <> 0
${If} $0 = 3010
SetRebootFlag true
${ElseIf} $0 <> 0
MessageBox MB_OK|MB_ICONSTOP "$(DOTNETINSTERROR)"
Quit
${EndIf}
${ElseIf} $0 == "cancel"
Quit
${Else}
MessageBox MB_OK|MB_ICONSTOP "$(DOTNETINSTERROR)"
Quit
${EndIf}
${ElseIf} $0 == "cancel"
Quit
${Else}
MessageBox MB_OK|MB_ICONSTOP "$(DOTNETINSTERROR)"
Quit
${EndIf}
${EndIf}
${EndIf}
Expand Down Expand Up @@ -713,7 +715,6 @@ SkipIniMove:
${EndIf}

; Cleanup old stuff
Delete "$INSTDIR\Rainmeter.exe.config"
Delete "$INSTDIR\Rainmeter.chm"
Delete "$INSTDIR\Default.ini"
Delete "$INSTDIR\Launcher.exe"
Expand Down Expand Up @@ -746,6 +747,7 @@ SkipIniMove:
${Else}
!insertmacro InstallFiles "x64"
${EndIf}
File "..\..\Application\Rainmeter.exe.config"

RMDir /r "$INSTDIR\Languages"
SetOutPath "$INSTDIR\Languages"
Expand Down Expand Up @@ -991,6 +993,7 @@ Section Uninstall
RMDir /r "$INSTDIR\Fonts"
Delete "$INSTDIR\Rainmeter.dll"
Delete "$INSTDIR\Rainmeter.exe"
Delete "$INSTDIR\Rainmeter.exe.config"
Delete "$INSTDIR\SkinInstaller.exe"
Delete "$INSTDIR\uninst.exe"

Expand Down

0 comments on commit f6461a1

Please sign in to comment.