๋ฐ˜์‘ํ˜•

์žฌ๋ฐฐํฌ ํŒจํ‚ค์ง€(Visual C++ Redistribution Package)

ํŠน์ • ํ”„๋กœ๊ทธ๋žจ์„ ์„ค์น˜ํ•˜๋‹ค ๋ณด๋ฉด ๋น„์ฃผ์–ผ C++ ์žฌ๋ฐฐํฌ ํŒจํ‚ค์ง€ ์„ค์น˜๊ฐ€ ํ•„์š”ํ•˜๋‹ค๋Š” ๋ฉ”์‹œ์ง€๋ฅผ ๋ณด๋Š” ๊ฒฝ์šฐ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ๋น„์Šทํ•˜๊ฒŒ .Net ํ”„๋ ˆ์ž„ ์›Œํฌ ์„ค์น˜๊ฐ€ ํ•„์š”ํ•˜๋‹ค๋Š” ๋ฉ”์‹œ์ง€๋„ ์žˆ์Šต๋‹ˆ๋‹ค.

MFC์™€ ๊ฐ™์€ ํ™˜๊ฒฝ์—์„œ ๊ฐœ๋ฐœํ•œ ํ”„๋กœ๊ทธ๋žจ(exe)์„ ๋ฐฐํฌํ•  ๋•Œ, ์‚ฌ์šฉ์ž PC์— ์ด ํ”„๋กœ๊ทธ๋žจ์„ ์ง€์›ํ•˜๋Š” ํŒŒ์ผ์ด ํ•„์š”ํ•œ๋ฐ์š”. ์ด๋Ÿฌํ•œ ํŒŒ์ผ ๊ตฌ์„ฑ์„ Microsoft์—์„œ ์ œ๊ณตํ•ด ์ฃผ๋Š” ํŒจํ‚ค์ง€๊ฐ€ ์žฌ๋ฐฐํฌ ํŒจํ‚ค์ง€์ž…๋‹ˆ๋‹ค.

Visual C++ 2013 ์žฌ๋ฐฐํฌ ํŒจํ‚ค์ง€ ๊ตฌ์„ฑ ํ™”๋ฉด

์ œ์–ดํŒ > ํ”„๋กœ๊ทธ๋žจ ๋ฐ ๊ธฐ๋Šฅ์—์„œ ์„ค์น˜๋œ ์žฌ๋ฐฐํฌ ํŒจํ‚ค์ง€ ๋ชฉ๋ก์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์žฌ๋ฐฐํฌ ํŒจํ‚ค์ง€ ์„ค์น˜ ๋ชฉ๋ก

Visual C++ ๋ฒ„์ „ ์ •๋ณด

์žฌ๋ฐฐํฌ ํŒจํ‚ค์ง€๊ฐ€ ๋ฌด์—‡์ธ์ง€ ์•Œ์•„ ๋ดค๋Š”๋ฐ์š”. NSIS ์ธ์Šคํ†จ๋Ÿฌ์— ์žฌ๋ฐฐํฌ ํŒจํ‚ค์ง€๋ฅผ ํฌํ•จํ•˜๊ธฐ ์ „์—, Visual C++ ๋ฒ„์ „์— ๋”ฐ๋ฅธ ์žฌ๋ฐฐํฌ ํŒจํ‚ค์ง€ ํŒŒ์ผ๊ณผ ๋ ˆ์ง€์ŠคํŠธ๋ฆฌ ์ฃผ์†Œ๋ฅผ ์•Œ์•„์•ผ ํ•ฉ๋‹ˆ๋‹ค.

์•„๋ž˜ ๋‚˜์—ดํ•œ ์ •๋ณด๋Š” ๋งํฌ๋ฅผ ์ฐธ๊ณ ํ•˜์—ฌ ์ •๋ฆฌํ–ˆ์Šต๋‹ˆ๋‹ค.
๋งํฌ: stackoverflow.com/questions/12206314/detect-if-visual-c-redistributable-for-visual-studio-2012-is-installed

Visual C++ 2005

Microsoft Visual C++ 2005 Redistributable (x64)
Registry Key: HKLM\SOFTWARE\Classes\Installer\Products\1af2a8da7e60d0b429d7e6453b3d0182
Configuration: x64
Version: 6.0.2900.2180
Download: Link
Microsoft Visual C++ 2005 Redistributable (x86)
Registry Key: HKLM\SOFTWARE\Classes\Installer\Products\c1c4f01781cc94c4c8fb1542c0981a2a Configuration: x86
Version: 6.0.2900.2180
Download: Link

Visual C++ 2008

Microsoft Visual C++ 2008 Redistributable - x64 9.0.30729.6161 (SP1)
Registry Key: HKLM\SOFTWARE\Classes\Installer\Products\67D6ECF5CD5FBA732B8B22BAC8DE1B4D Configuration: x64
Version: 9.0.30729.6161 (Actual $Version data in registry: 0x9007809 [DWORD])
Download: Link
Microsoft Visual C++ 2008 Redistributable - x86 9.0.30729.6161 (SP1)
Registry Key: HKLM\SOFTWARE\Classes\Installer\Products\6E815EB96CCE9A53884E7857C57002F0 Configuration: x86
Version: 9.0.30729.6161 (Actual $Version data in registry: 0x9007809 [DWORD])
Download: Link

Visual C++ 2010

Microsoft Visual C++ 2010 Redistributable (x64)
Registry Key: HKLM\SOFTWARE\Classes\Installer\Products\1926E8D15D0BCE53481466615F760A7F Configuration: x64
Version: 10.0.40219.325
Download: Link
Microsoft Visual C++ 2010 Redistributable (x86)
Registry Key: HKLM\SOFTWARE\Classes\Installer\Products\1D5E3C0FEDA1E123187686FED06E995A Configuration: x86
Version: 10.0.40219.325
Download: Link

Visual C++ 2012

Microsoft Visual C++ 2012 Redistributable (x64)
Registry Key: HKLM\SOFTWARE\Classes\Installer\Dependencies\{ca67548a-5ebe-413a-b50c-4b9ceb6d66c6}
Configuration: x64
Version: 11.0.61030.0
Download: Link
Microsoft Visual C++ 2012 Redistributable (x86)
Registry Key: HKLM\SOFTWARE\Classes\Installer\Dependencies\{33d1fd90-4274-48a1-9bc1-97e33d9c2d6f} Configuration: x86
Version: 11.0.61030.0
Download: Link

Visual C++ 2013

Microsoft Visual C++ 2013 Redistributable (x64)
Registry Key: HKLM\SOFTWARE\Classes\Installer\Dependencies\{050d4fc8-5d48-4b8f-8972-47c82c46020f} Configuration: x64
Version: 12.0.30501.0
Download: Link
Microsoft Visual C++ 2013 Redistributable (x86)
Registry Key: HKLM\SOFTWARE\Classes\Installer\Dependencies\{f65db027-aff3-4070-886a-0d87064aabb1} Configuration: x86
Version: 12.0.30501.0
Download: Link

Visual C+ 2015

Microsoft Visual C++ 2015 Redistributable (x64) - 14.0.24215
Registry Key: HKLM\SOFTWARE\Classes\Installer\Dependencies\{d992c12e-cab2-426f-bde3-fb8c53950b0d} Configuration: x64
Version: 14.0.24215.1
Download: Link
Microsoft Visual C++ 2015 Redistributable (x86) - 14.0.24215
Registry Key: HKLM\SOFTWARE\Classes\Installer\Dependencies\{e2803110-78b3-4664-a479-3611a381656a}
Configuration: x86
Version: 14.0.24215.1
Download: Link

Visual C++ 2017

Microsoft Visual C++ 2017 Redistributable (x64) - 14.16.27012
Registry Key: [HKEY_CLASSES_ROOT\Installer\Dependencies\VC,redist.x64,amd64,14.16,bundle\Dependents\{427ada59-85e7-4bc8-b8d5-ebf59db60423}]
Configuration: x64
Version: 14.16.27012.6
Download: Link
Microsoft Visual C++ 2017 Redistributable (x86) - 14.16.27012
Registry Key: [HKEY_CLASSES_ROOT\Installer\Dependencies\VC,redist.x86,x86,14.16,bundle\Dependents\{67f67547-9693-4937-aa13-56e296bd40f6}]
Configuration: x86
Version: 14.16.27012.6
Download: Link

Visual C++ 2019 (2015-2019 bundle)

14.21.27702

Microsoft Visual C++ 2015-2019 Redistributable (x64) - 14.21.27702
Registry Key: [HKEY_CLASSES_ROOT\Installer\Dependencies\VC,redist.x64,amd64,14.21,bundle\Dependents\{f4220b74-9edd-4ded-bc8b-0342c1e164d8}]
Configuration: x64
Version: 14.21.27702
Download: Link
Microsoft Visual C++ 2015-2019 Redistributable (x86) - 14.21.27702
Registry Key: [HKEY_CLASSES_ROOT\Installer\Dependencies\VC,redist.x86,x86,14.21,bundle\Dependents\{49697869-be8e-427d-81a0-c334d1d14950}]
Configuration: x86
Version: 14.21.27702
Download: Link

14.22.27821

Microsoft Visual C++ 2015-2019 Redistributable (x86) - 14.22.27821
Registry Key: [HKEY_CLASSES_ROOT\Installer\Dependencies\VC,redist.x86,x86,14.22,bundle\Dependents\{5bfc1380-fd35-4b85-9715-7351535d077e}]
Configuration: x86
Version: 14.22.27821
Download: Link
Microsoft Visual C++ 2015-2019 Redistributable (x86) - 14.22.27821
Registry Key: [HKEY_CLASSES_ROOT\Installer\Dependencies\VC,redist.x64,amd64,14.22,bundle\Dependents\{6361b579-2795-4886-b2a8-53d5239b6452}]
Configuration: x64
Version: 14.22.27821
Download: Link

์žฌ๋ฐฐํฌ ํŒจํ‚ค์ง€ ์Šคํฌ๋ฆฝํŠธ ์ถ”๊ฐ€ํ•˜๊ธฐ

์ธ์Šคํ†จ๋Ÿฌ์— ํฌํ•จํ•  ์žฌ๋ฐฐํฌ ํŒจํ‚ค์ง€๋ฅผ ๋‹ค์šด๋กœ๋“œ ๋ฐ›์œผ์…จ๋‚˜์š”? ๋ณธ๋ฌธ์—์„œ๋Š” Visual C++ 2015 x64๋ฅผ ํฌํ•จ์‹œ์ผœ ์ง„ํ–‰ํ•ด ๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. ์Šคํฌ๋ฆฝํŠธ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

;์„ค์น˜๊ฐ€ ์™„๋ฃŒ๋˜๊ธฐ ์ „์— ํ˜ธ์ถœ๋˜๋Š” Section.
Section -InnoSetup
;CheckVCRedist2015 Function์„ ํ˜ธ์ถœ.
Call CheckVCRedist2015
Pop $R9 ;R9 ๋ณ€์ˆ˜๋ฅผ ๊บผ๋‚ธ๋‹ค.
StrCmp $R9 "No" 0 +2 ;R9 ๋ณ€์ˆ˜๊ฐ€ No๋ผ๋ฉด ์•„๋ž˜ ExecWait๋ฅผ ํ˜ธ์ถœํ•˜๊ณ , ๊ทธ๋ ‡์ง€ ์•Š๋‹ค๋ฉด SectionEnd๋ฅผ ์ˆ˜ํ–‰ํ•œ๋‹ค.
ExecWait "$INSTDIR\Driver\vc_redist.x64.exe"
SectionEnd

Function CheckVCRedist2015
Push $R9
ClearErrors
  ;64bit OS์ธ ๊ฒฝ์šฐ.
  SetRegView 64 
  ;Registry Version์„ ์ฝ๋Š”๋‹ค.
  ReadRegStr $R9 HKLM "SOFTWARE\Classes\Installer\Dependencies\{d992c12e-cab2-426f-bde3-fb8c53950b0d}" "Version"
  ; if VS 2015 redist not installed, install it
  IfErrors 0 VSRedistInstalled
  StrCpy $R9 "No" ;Registry๊ฐ€ ์—†๋‹ค๋ฉด R9 ๋ณ€์ˆ˜์— No๋ฅผ ๋ณต์‚ฌ.
VSRedistInstalled: ;Registry๊ฐ€ ์žˆ๋‹ค๋ฉด R9 ๋ณ€์ˆ˜์— ์„ค์น˜๋œ ๋ฒ„์ „์„ ๋ณต์‚ฌ.
  Exch $R9
FunctionEnd

NSIS์—์„œ ์ฃผ์„์€ ; ์ž…๋‹ˆ๋‹ค. ์Šคํฌ๋ฆฝํŠธ์˜ ๊ฐ ๋ช…๋ น์–ด์— ๋Œ€ํ•œ ์„ค๋ช…์„ ์ฃผ์„์œผ๋กœ ๋‚จ๊ฒผ์Šต๋‹ˆ๋‹ค. ์œ„ ๋™์ž‘์„ ์ •๋ฆฌํ•˜๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

โ‘  Visual C++ 2015์˜ ๋ ˆ์ง€์ŠคํŠธ๋ฆฌ๋ฅผ ํƒ์ƒ‰ํ•˜์—ฌ ๋ฒ„์ „ ํ™•์ธ.
โ‘ก ๋ฒ„์ „์ด ์—†๋‹ค๋ฉด ์„ค์น˜ ์ง„ํ–‰.
โ‘ข ๋ฒ„์ „์ด ์žˆ๋‹ค๋ฉด ์ข…๋ฃŒ.

ํ•˜๋‹จ์— ์ฒจ๋ถ€๋œ ์˜ˆ์ œ NSI ํŒŒ์ผ์„ ์‹คํ–‰ํ•˜๋ฉด, ์„ค์น˜ ๊ณผ์ • ์ค‘์— ์•„๋ž˜์™€ ๊ฐ™์ด ์ฐฝ์ด ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.

์žฌ๋ฐฐํฌ ํŒจํ‚ค์ง€ ์„ค์น˜ ์—ฌ๋ถ€ ๋ฉ”์‹œ์ง€

์˜ˆ์ œ ํŒŒ์ผ: 1drv.ms/u/s!AhrLbATTcIfkxVoHgYDhHGMj77xL?e=FOv250

๋ฐ˜์‘ํ˜•