PortableApps.com wins big in the 2009 Community Choice Awards and hits 100 million app downloads!

FilesToPreserve question

Submitted by prapper on September 22, 2009 - 3:15am

If I use this to preserve "appinfo.ini" (so I can read the installed version on an upgrade) everything works fine, as long as the file exists. If it's a fresh install, the installer complains that it's corrupt and quits.

Is it a bug or is there some reason I shouldn't be doing this?


( categories: )

Shouldnt

the appinfo.ini be updated with a new version number?

"What about Love?" - "Overrated. Biochemically no different than eating large quantities of chocolate." - Al Pacino in The Devils Advocate

Yes it should, and it is, but

Yes it should, and it is, but I thought it would be helpful to be able read it first and then add some custom pre-install code, depending on what version number it returned.

It does work, just not with a fresh install.

No need to preserve the file,

if you use custom pre-install code. Guess why it's called pre-install code Eye-wink
Look at the custom installer code of Notepad++ Portable, it's doing what you're looking for.

But the App directory is

But the App directory is removed before the installer hits custom code pre-install. In the Notepad++ "installer.ini" the whole app directory is preserved and selected items are removed.

I suppose it's the same thing, just approached from a different (completely opposite) direction. I thought it would be easier to just preserve one file. Thanks for the pointer though.

Guess it should be called "custom code pre install post delete" :-)

Anyway, the point wasn't that it didn't work, it was that it crashed the installer if it was a fresh install.

You're right,

but i call that [Bug] and not "custom code pre install post delete". Pre-Install code should be really "pre" and not "between" Sad

Edit:
If you preserve just one file (appinfo.ini), it'll be moved to "`$INSTDIR\~PRESERVEFILE1`" before executing custom pre-install code. Thus the installer (pre-install custom code) won't find "$INSTDIR\App\AppInfo\appinfo.ini" and will fail.

I was using offsets instead

I was using offsets instead of labels. Using labels gives much more predictable results. Obviously. Sorry about that...

There should be a manual for this stuff really.

Reverse engineering

and debugging is much more fun than reading a manual Laughing out loud