Avatar of Skip_Laughlin
 asked on

INNO Setup Paschal code needed

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.

Avatar of undefined
Last Comment

8/22/2022 - Mon

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.

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?

The NOT worked for me.  
Dumb question, are you on Win64 when you tested?  
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck

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?

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.

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?

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.  
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question

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?

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

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