Hyun Chul's Utopia
지극히 개인적인 CD 오토런 프로그램 제작 본문
정말 지극히 개인적으로 Autorun을 제작해 봤습니다. 그냥 말이 Autorun이지 그냥 셋업파일 연결시켜주는 간단한 프로그램이 되겠네요.
사건의 전말은 공DVD 한장에 MS Office 2007, 2010 과 한컴오피스2007 을 모두 집어넣어 한장의 CD로 만들고 싶었다는거네요.. 정품CD에서 컴퓨터로 파일 복사 시키고 그냥 간단히 이들 셋업파일을 실행시켜주는 프로그램입니다.
약간 해맸던점은 한컴오피스 2007의 경우는 제가 만든 프로그램이 다른 경로에 있으면 정품사용자가 아니라고 반항을 하더라는 점이었는데..(한글 정품CD 유저란 말이다!!) 약간 삽질한 끝에 그냥 현재 경로를 이동시키면 되겠구나 하면서 해결 봤네요..
소스는 지극히 더럽습니다 욕하지 말아주세요 ㅠ
사용 안하는 변수나 define이 있을수 있습니다;;;;;
● Autorun.c
#include#include #include #include #include #include #include #define MAX_COMMAND_OPTION_SIZE 100 #define PATH_PROGRAM_MS2007 1_Microsoft_Office_2007\setup.exe #define PATH_PROGRAM_MS2007_KEY 1_Microsoft_Office_2007\Microsoft Office 2007 Keygen.exe #define PATH_PROGRAM_MS2010 2_Microsoft_Office_2010\setup.exe #define PATH_PROGRAM_MS2010_KEY 2_Microsoft_Office_2010\mini-KMS_Activitor_v1.1_Office.2010.VL.ENG.exe #define PATH_PROGRAM_HAN2007 3_Hancom_Office_2007_Install\install.exe #define PATH_PROGRAM_HAN2007_KEY 4_Hancom_Office_2007_Ext\install.exe #define KEY_PROGRAM_MS2007 1 #define KEY_PROGRAM_MS2007_KEY 2 #define KEY_PROGRAM_MS2010 3 #define KEY_PROGRAM_MS2010_KEY 4 #define KEY_PROGRAM_HAN2007 5 #define KEY_PROGRAM_HAN2007_KEY 6 #define BASIC_PATH_LENGTH 100 TCHAR BASIC_PATH[BASIC_PATH_LENGTH]; char inputNumber() { char in; printf(" Select Number....."); printf("\n 1 : MS Office 2007 Pro\n"); printf(" 2 : MS Office 2007 Pro KeyGen\n"); printf(" 3 : MS Office 2010 VL\n"); printf(" 4 : MS Office 2010 VL KeyGen\n"); printf(" 5 : Hancom Office 2007 Install\n"); printf(" 6 : Hancom Office 2007 Update Pack\n"); printf(" 0 : EXIT"); printf("\n\n ++++ Select Number : "); in = getch(); printf("%c\n", in); return in; } DWORD WINAPI startProgram(LPVOID lpParam){ DWORD input = *(DWORD*)lpParam; char path[50]; SetCurrentDirectoryW(BASIC_PATH); if(input == 1){ system("1_Microsoft_Office_2007\\setup.exe"); printf("\n !!! END !!! < MS Office 2007 Pro >"); printf("\n"); }else if(input == 2) { system("1_Microsoft_Office_2007\\Keygen.exe"); printf("\n !!! END !!! < MS Office 2007 Pro KeyGen >"); printf("\n"); }else if(input == 3) { system("2_Microsoft_Office_2010\\setup.exe"); printf("\n !!! END !!! < MS Office 2010 VL >"); printf("\n"); }else if(input == 4) { system("2_Microsoft_Office_2010\\keygen.exe"); printf("\n !!! END !!! "); printf("\n"); }else if(input == 5) { SetCurrentDirectoryW(_T(".\\3_Hancom_Office_2007_Install")); system("install.exe"); printf("\n !!! END !!! < Hancom Office 2007 Install >"); printf("\n"); }else if(input == 6) { SetCurrentDirectoryW(_T(".\\4_Hancom_Office_2007_Ext")); system("install.exe"); printf("\n !!! END !!! < Hancom Office 2007 Update >"); printf("\n"); } printf("\n\n ++++ Select Number : "); return 0; } int _tmain() { char input = 0; DWORD dwThrdId, dwThrdParam = 1; HANDLE hThread; system("color 2"); system("mode con cols=50 lines=30"); printf("#################################################\n"); printf(" My Office Pack \n"); printf(" Made By BHC.\n"); printf("#################################################\n"); GetCurrentDirectoryW(BASIC_PATH_LENGTH, BASIC_PATH); while(1) { input = 0; input = inputNumber(); if(input == '1'){ printf("\n Select Number is ' 1 ' .....\n Start Install < MS Office 2007 Pro >"); printf("\n"); dwThrdParam = 1; hThread = CreateThread( NULL, 0, startProgram, &dwThrdParam, 0, &dwThrdId); if(hThread == NULL){ printf("Error CreateThread().....\n\n"); } }else if(input == '2') { printf("\n Select Number is ' 2 ' .....\n Start Install < MS Office 2007 Pro KeyGen >"); printf("\n"); dwThrdParam = 2; hThread = CreateThread( NULL, 0, startProgram, &dwThrdParam, 0, &dwThrdId); if(hThread == NULL){ printf("Error CreateThread().....\n\n"); } }else if(input == '3') { printf("\n Select Number is ' 3 ' .....\n Start Install < MS Office 2010 VL >"); printf("\n"); dwThrdParam = 3; hThread = CreateThread( NULL, 0, startProgram, &dwThrdParam, 0, &dwThrdId); if(hThread == NULL){ printf("Error CreateThread().....\n\n"); } }else if(input == '4') { printf("\n Select Number is ' 4 ' .....\n Start Install "); printf("\n"); dwThrdParam = 4; hThread = CreateThread( NULL, 0, startProgram, &dwThrdParam, 0, &dwThrdId); if(hThread == NULL){ printf("Error CreateThread().....\n\n"); } }else if(input == '5') { printf("\n Select Number is ' 5 ' .....\n Start Install < Hancom Office 2007 Install >"); printf("\n"); dwThrdParam = 5; hThread = CreateThread( NULL, 0, startProgram, &dwThrdParam, 0, &dwThrdId); if(hThread == NULL){ printf("Error CreateThread().....\n\n"); } }else if(input == '6') { printf("\n Select Number is ' 6 ' .....\n Start Install < Hancom Office 2007 Update >"); printf("\n"); dwThrdParam = 6; hThread = CreateThread( NULL, 0, startProgram, &dwThrdParam, 0, &dwThrdId); if(hThread == NULL){ printf("Error CreateThread().....\n\n"); } }else if(input == '0') { printf("\n-------------------------------------------------"); printf("\n Select Number is ' 0 ' .....\n Exit Program........\n"); printf("\n Made By Bae Hyun-Chul.\n"); printf("\n"); printf("#################################################\n"); printf("\n\n"); break; }else { printf("\n This is not a number as possible."); printf("\n"); } printf("\n-------------------------------------------------\n"); } return 1; }
이건 실행화면...
Comments