Making an installer package using a console app

This is a discussion on Making an installer package using a console app within the C++ Programming forums, part of the General Programming Boards category; Can you make a basic installer package that runs under the console, and not under windows???...

  1. #1
    Registered User Finchie_88's Avatar
    Join Date
    Aug 2004
    Posts
    154

    Question Making an installer package using a console app

    Can you make a basic installer package that runs under the console, and not under windows???

  2. #2
    hacker in training AdamLAN's Avatar
    Join Date
    Sep 2004
    Posts
    56
    If you find out, tell me PLEASE. Even if the answer is for Windows, please tell me if you get the chance.
    Thank you.

  3. #3
    i dont know Vicious's Avatar
    Join Date
    May 2002
    Posts
    1,200
    I have absolutely NO idea how installer programs work.

    The only way I can imagine is to make the app and read it into an array in your installer. I havent tried this but it seems logical.

    Unless there is some way to acually append dataonto your actual application.
    What is C++?

  4. #4
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    I think installers just do any pre-run stuff that needs doing. Such as, for example, copying the files to the appropriate location (files might be stored in an archive file format, so it would also decompress them), adding a registry key pointing to the program directory, or whatever else might need doing. So your 'installer' could simply be (ignoring security risks):

    Code:
    system("copy myprog.arc c:\\MyProg\\myprog.exe");
    If you're talking about the flashy "InstallShield" thing, MSVC Pro (not sure bout standard and others) comes with "InstallShield Wizard for MSVC", supposedly you can make installers with it.
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  5. #5
    i dont know Vicious's Avatar
    Join Date
    May 2002
    Posts
    1,200
    Hunter are you saying you can access your executable while its in use?

    I think the main question was how do you make an application that stores a separate application within it. So theres one .exe that puts an .exe and other files into a folder.
    What is C++?

  6. #6
    unleashed alphaoide's Avatar
    Join Date
    Sep 2003
    Posts
    696
    What I'm getting is you'll have at least two files
    program.exe, the actual program you want to install
    install.exe, a program which copies 'program.exe' to a specifed location (see hunter's post)
    source: compsci textbooks, cboard.cprogramming.com, world wide web, common sense

  7. #7
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    I think the main question was how do you make an application that stores a separate application within it. So theres one .exe that puts an .exe and other files into a folder.
    I'm sure there's a way to do it.. after all, self-extracting zips do it I'll run a quick test though..
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  8. #8
    C(++)(#)
    Join Date
    Jul 2004
    Posts
    309
    Is it possible that the installer simply hold all resource files and source files, then compiles them, and places them into the directory, while copying the other needed files into the said directories?
    To code is divine

  9. #9
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,265
    Installer programs which are not console based simply insert the files they want to install as resources in their programs. Then they can use the resource API functions to extract the resources from the .exe and use them as they see fit.

    As a console application, you cant use resources. In this case, you need to pad the end of your .exe with the files that you want to install. Then from your .exe you open up your .exe for reading only. Then you fseek() to the end of your executable code, where the start of your padding is. Here you read the padded installation files and write them to where ever you want on the hard drive. This method is a little trickier than the resource method, because you need to know beforehand how far to seek into the file. Either way though, it's not that hard.

  10. #10
    i dont know Vicious's Avatar
    Join Date
    May 2002
    Posts
    1,200
    Thats what i was thinking.. BUT couldint you store them into buffers in your program. Seems alot simpler.
    What is C++?

  11. #11
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,265
    It wouldnt be easier. Since the files are most likely binary, how would you input that into a buffer? There would be a lot of escape characters needed there.

  12. #12
    i dont know Vicious's Avatar
    Join Date
    May 2002
    Posts
    1,200
    Couldnt you read in the executable byte by byte into an unsigned char array? Maybe im confusing myself...
    What is C++?

  13. #13
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,265
    You could, but how would that help? Remember that the goal is to have all the installation files within a single executable. Its possible that maybe I'm not understanding what you are getting at here. Could you give a small example of what you mean to ensure we are on the same page?

  14. #14
    Software Developer jverkoey's Avatar
    Join Date
    Feb 2003
    Location
    University of Waterloo
    Posts
    1,904
    Welcome to the world of OpenSource

    NSIS

  15. #15
    i dont know Vicious's Avatar
    Join Date
    May 2002
    Posts
    1,200
    Quote Originally Posted by bithub
    You could, but how would that help? Remember that the goal is to have all the installation files within a single executable. Its possible that maybe I'm not understanding what you are getting at here. Could you give a small example of what you mean to ensure we are on the same page?
    Wel the more I thought it out.. the more i realized it would be extremely difficult. So mevermind

    I wasnt thnking it all out. But your right bith
    What is C++?

Page 1 of 2 12 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to execute a console command from your app?
    By GUIPenguin in forum C# Programming
    Replies: 2
    Last Post: 07-06-2006, 10:36 AM
  2. Using C++ to run a Console APP?
    By anon2222 in forum C++ Programming
    Replies: 4
    Last Post: 01-10-2006, 08:07 AM
  3. Making a virtual console (Linux)
    By Moddy in forum C++ Programming
    Replies: 2
    Last Post: 12-16-2005, 12:54 PM
  4. Making standalone APP run in background
    By hart in forum Windows Programming
    Replies: 3
    Last Post: 02-27-2005, 11:20 AM
  5. making a stealthy win32 console application?
    By killdragon in forum C++ Programming
    Replies: 3
    Last Post: 09-08-2004, 03:50 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21