INNO Setup Paschal code needed

Skip_Laughlin
Skip_Laughlin used Ask the Experts™
on
I need some help please.  I need some Paschal code which will combine the system function IsWin64 and a custom function to determine if a file exists on the target PC.  I need the [Run] Filename statement to execute if IsWin64 is true and if this particular file does not exist in a particular folder on the target PC.  The filename statement would include "Check: somefunction;" to be True or False.

I appreciate any input.  Thanks.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
MirtheilSoftware Developer

Commented:
Your Check statement can have multiple conditions.  Something like:

 
Check: IsWin64 and FileExists(ExpandConstant('{app}\appname.exe'))

Open in new window


You don't even need a Code section for this check.  You can change the parameter in the FileExists to match your application name or any other filename.

Author

Commented:
Ahh.  Too simple for my simple mind.  I like it.

This is what I did

Check:  Iswin64 and not FileExists(ExpandConstant('{app}\mdb\my.file'))

and it does not seem to work whether the my.file is present or not.  Will the NOT not work in this case?
MirtheilSoftware Developer

Commented:
The NOT worked for me.  
Dumb question, are you on Win64 when you tested?  
CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

Author

Commented:
Probably a good question for me.  Yes, the laptop I am testing on is Windows 7 64-bit.  Actually, there are 4 conditional statements.  Conditional on Vista or W7, 64-bit or not.  

OK, yes it does work.  I was trying to test for the existence of a file to determine if this update had been run previously.  But the file was getting installed in the [Files] section, so was already present every time.  

What I need to do is determine the version of an unrelated windows system exe to see if the update has been run previously.  I haven't found a way to do that with function or code.  Would you have a recommendation?

Author

Commented:
mirtheil, according to my limited knowledge, the following would serve to place a marker file in the app to indicate that this SETUP has been run on the instant PC.

[Run]
filename: c:\windows\system32\xcopy; parameters: """{src}\MDB_Update\MDB.UPD {app}\mdb\MDB.upd"""

But it won't run.  Can you pls tell me the correct syntax?
MirtheilSoftware Developer

Commented:
Well, your parameters are incorrect for the xcopy. You should use something like:

 
filename: {sys}xcopy.exe; parameters: """{src}\MDB_Update\MDB.UPD"" ""{app}\mdb\MDB.upd"""

Open in new window


But, that will cause a command window to display and will ask for confirmation as to whether the destination is a file or directory.  The /i parameter should help but it hasn't in my testing.  
Software Developer
Commented:
Now, if you are looking for another way of finding out if an update has been applied I've got a suggestion.  
In my installs, both personally and professionally, I use a registry setting to store the full version including the build.  I can then in my next update, check that registry setting and compare it and decide if an update has been applied or not.

Author

Commented:
I agree the registry entry would be the most elegant solution.  But that is way, way beyond my capabilities.  Is there anyway for us to discuss privately without being banned from EE?
MirtheilSoftware Developer

Commented:
Working with the registry isn't too hard but takes some time.  

I'm sure there are ways of communicating if you look around.  

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial