Bonjour, je suis actuellement en train de coder un check de logiciel sur un source code d'un jeu édité en C++.

Lorsque la personne est sur le launcher du jeu il y a un check si la personne possède DirectX11 et VC ++ 2012

Voici la fonction :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
void Check_for_VCRedistributive()
 
{
 
    //Frage: Check for VC++ Redistributive
 
int result;
 
    HKEY register_Key;
 
    //result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\DevDiv\\vc\\Servicing\\12.0", 0, KEY_ALL_ACCESS, &register_Key);
 
result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\DevDiv\\vc\\Servicing\\12.0\\RuntimeMinimum\\Install", 0, KEY_READ, &register_Key);
 
    if(result == ERROR_SUCCESS)
 
        return;
 
 
 
STARTUPINFO si = {sizeof (STARTUPINFO)};
 
    PROCESS_INFORMATION pi;
 
    CreateProcess("vcredist_x64.exe", NULL, 0, 0, 0, 0, 0, 0, &si, &pi);
 
    WaitForSingleObject(pi.hProcess, INFINITE);
 
}
Le problème est que, même si la personne possède le logiciel, à jour, l'exe d'installation ce lance quand même.

http://prntscr.com/aqa470

(je suis débutant en codage)

-
Edité par Frage il y a environ 10 heures