how to zip then unzip files to different directories...


  1. Posts : 10
    windows 7
       #1

    how to zip then unzip files to different directories...


    Hi. My final project has main.exe, config.txt and template.xlsx files. I would like to somehow zip all these into one installation file such that once the user double click on it, it will extract main.exe onto the desktop; config.txt in c:\ and template.xlsx in c:\...\Documents.

    Please advise. Thank you.
      My Computer


  2. Posts : 1,049
    Windows 7 Pro 32
       #2

    You could create a self extracting exe using 7-zip and include a batch file that you instruct the users to run after. The batch file would then move the files to their corresponding folders.

    Or have the self extracting exe run the batch file automatically: windows - Is it possible to execute a file after extraction from a 7-Zip self-extracting archive (SFX) archive? - Super User

    Haven't tested myself though.
      My Computer


  3. Posts : 2,468
    Windows 7 Ultimate x64
       #3

    Consider using something like NSIS to create a real installer instead, thus getting a .msi package that you then distribute. It can deploy all the files anywhere you want them and all necessary configurations. Using zip files for distribution is only good if your program is suitable for xcopy deployment (that is, everything together in a single location, or "portable" as people like to call it).

    BTW, I think your desired paths are not a good choice. When deploying programs you should try to adhere to the standard of how Windows programs are installed. The main .exe goes into program files in its own folder, with a shortcut in desktop or start menu. Config file should never go into root folder (it's not user writable), it's better to put it under AppData in each user profile, and better to create it on first run instead of on-install (with the defaults parameters hardcoded into the exe for creating it). As for the templates, it depends on what purpose they serve and if they'll be modified. The program files folder or in AppData seems good places in each cases, but most likely my documents will only add clutter for the user.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 03:54.
Find Us