It's certainly possible to do. Gossamer Threads is now doing this for their newer software. You run their install program from command line, it asks you set up questions, then extracts files, creates directories, and chmod's everything for you. It might be worth sending Alex Krohn an email and maybe he'll give you some pointers.

The shar command bundles the named files and directories into a single distribution package suitable for mailing or moving. The files can contain any data, including executables. The resulting package, written to standard output, is a shell script file that can be edited (to add messages at the beginning, etc.).

I want to make a simple CGI program, named install.cgi. In the same directory there should be a compressed data file. The cgi prgoram extracts the data, installs and chmods evrything. Later, It should ask the user (webmaster/installer) about some variables set in the CGI program.

This would be a lot easier to other people using a complex cgi program.