문제 설명
Inno Setup을 사용하여 현재 날짜를 레지스트리에 바이너리 형식으로 저장 (Storing the current date to the registry in binary format with Inno Setup)
Inno Setup을 사용하여 현재 날짜를 레지스트리 키에 바이너리 데이터로 쓸 수 있습니까? (문자열이면 변경하기가 매우 쉽습니다.)
내 MFC C++ 프로젝트에서 DATE
변수를 사용하여 WriteProfileBinary
.
결국 나는 읽을 수 있어야 합니다. 이 값을 DateTime
.NET C#을 사용하는 변수. 존재하지 않는 경우에만 값을 저장하기 위해 공통 프로그램 데이터 키를 사용할 것입니다.
[레지스트리]
는 이진 데이터에 적합합니다.
binary
가 지정된 경우 설치 프로그램은 바이너리(REG_BINARY
) 값을 생성합니다 ... 데이터 유형이binary
인 경우 형식의 16진수 바이트 시퀀스입니다. :"00 ff 12 34"
.
타임스탬프를 어떻게 필요한 형식으로 변환합니까?<
참조 솔루션
방법 1:
To write the current date to registry as a binary value, you can do something like this:
var
DateStr: string;
begin
DateStr := GetDateTimeString('yyyy/mm/dd', '‑', ':');
RegWriteBinaryValue(
HKEY_AUTO, 'Software\My Company\My Program', 'InstallDate', DateStr);
end;
It will result in:
C:\>reg query "HKCU\Software\My Company\My Program"
HKEY_CURRENT_USER\Software\My Company\My Program
InstallDate REG_BINARY 323032312D31302D3039
You can do even more obfuscation if you like. No matter what you do, user will be able to modify the value with more or less effort.
(by Andrew Truckle、Martin Prikryl)