0

I have a python app and right now am creating the installation exe using Inno-setup. And now I want after the user installs all the files using that installation exe. I want it to make a zip file with all previous files and folders that have been installed, And store this .zip file at AppData/local for example.

So how can I achieve that?

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Uncle Bob
  • 155
  • 8
  • Duplicate to [Inno Setup – zip local files prior to an update](https://stackoverflow.com/q/19832128/850848). Though as there was no really good answer, I've added [my own](https://stackoverflow.com/q/19832128/850848#70079806). – Martin Prikryl Nov 23 '21 at 11:13
  • Thank you for your comment, So that's the code that you have written, I should put it in the [code] section? and what's next in order to run that's code. Am sorry but actually, I have not much exp with inno setup :D. – Uncle Bob Nov 23 '21 at 11:39
  • Yes, just put it to the `[Code]` section. That's all. The `CurStepChanged` is an event function. It gets executed on its own. You just need to modify the code to put the ZIP to `{localappdata}`, instead of `{app}`. And then you won't need the temporary ZIP (it's there to avoid archiving the ZIP itself, when it is stored to the `{app}`). So you can skip the `FileCopy`. – Martin Prikryl Nov 23 '21 at 11:43
  • Actually, that's code that you have posted is really helpful, but it will work only after the first install, What I need is After the installation it will create that zip file. and the second question is that archiving the folders takes more than 1-2 min and there is nothing say what is happing (for the user he will wait) how could tell user what is happening right now – Uncle Bob Nov 23 '21 at 12:46
  • Actually, i find the solution in my case by changing the `CurStep = ssInstall ` to `CurStep = ssPostInstall`, There is no problem with that, but `ssinstall` will create the archive if there is a 'DirExists(AppPath)' Which at first install will not exist, and then it won't create that archive. **The last question** Is there any way to show the user that we are doing smth while creating that archive because it takes time and there is no msgs show. – Uncle Bob Nov 23 '21 at 13:00
  • Well, the other question is about archiving previous installation before installing an update. + If you want to ask about displaying what is happening, please edit your question accordingly. – Martin Prikryl Nov 23 '21 at 13:12

0 Answers0