You are here

FilesToPreserve question

8 posts / 0 new
Last post
prapper
Offline
Last seen: 3 years 10 months ago
Developer
Joined: 2008-01-24 17:01
FilesToPreserve question

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?

Simeon
Simeon's picture
Offline
Last seen: 10 years 2 months ago
DeveloperTranslator
Joined: 2006-09-25 15:15
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

prapper
Offline
Last seen: 3 years 10 months ago
Developer
Joined: 2008-01-24 17:01
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.

Bart.S
Offline
Last seen: 6 months 3 weeks ago
Developer
Joined: 2008-07-23 07:56
No need to preserve the file,

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

prapper
Offline
Last seen: 3 years 10 months ago
Developer
Joined: 2008-01-24 17:01
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.

Bart.S
Offline
Last seen: 6 months 3 weeks ago
Developer
Joined: 2008-07-23 07:56
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.

prapper
Offline
Last seen: 3 years 10 months ago
Developer
Joined: 2008-01-24 17:01
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.

Bart.S
Offline
Last seen: 6 months 3 weeks ago
Developer
Joined: 2008-07-23 07:56
Reverse engineering

and debugging is much more fun than reading a manual Biggrin

Log in or register to post comments