rewrite install program in C