Jump to content

How do I use the {Filecopy} when I am using both x86 and x64


Recommended Posts

I'm really confused. I have most of my programs set up in WPI for my 32bit computer, but when I tried to use it on a 64bit, I ran into a problem. The files that were supposed to be copied into the %ProgramFiles%, never copied because they are not set to go into %ProgramFiles(x86)%. Do I have to set up two entries for every program (one for x86 and one for x64), or is there a way for it to check and install to the correct directory. I thought maybe this is done by using the conditions, but if this is true could somebody give me an example or point me in the right direction? Because I have no idea how to use the conditions.

Link to comment
Share on other sites


Why and what are you directly copying into ProgramFiles?

Unless you make dedicated 32bit and 64bit versions, you will have to do it all twice and use dependencies.

For example, I have a 32 bit program that I want WPI to install and then after installation to have a password.bin file copied into a folder in the corresponding program files directory. However, since I have both 32bit and 64bit programs in WPI, it will be a different location depending on which OS I am installing to.

If I am using a 32bit os, then I want it like this: %ProgramFiles%\Foldername\password.bin

If I am using a 64bit os, then I want it like this: %ProgramFiles(x86)%\Foldername\password.bin

So what you are saying is that I have to set up two entries in WPI for each and every program I have in there? Like this:

RoboForm 7 (x86)

RoboForm 7 (x64)

Office 2007 (x86)

Office 2007 (x64)

etc, etc...

Edited by jadtunrau
Link to comment
Share on other sites

Yes. Either make 2 entries for each instance.

OR.....make 2 separate config.js files: configx64.js and configx86.js. Then use command line args to specify which to use.

There is no easy way around this.

Link to comment
Share on other sites

Yes. Either make 2 entries for each instance.

OR.....make 2 separate config.js files: configx64.js and configx86.js. Then use command line args to specify which to use.

There is no easy way around this.

I understand. I think I'll try option two and make two seperate config files as you suggested - seems to me that it would be a bit more convenient. Can you give me an example command line argument specifying which to use?

Edited by jadtunrau
Link to comment
Share on other sites

Can somebody point me in the right direction for using a command line argument to specify which config.js (either configx86.js or configx64.js) would be used based on whether I have a 64-bit or 32-bit OS installed. An example command line would be great! :)

Link to comment
Share on other sites

Command line uses of WPI

WPI supports the use of command line arguments for selection of custom files and time for even further customization of your WPI disks or setups.

Example: WPI.exe options=useroptions_mritter.js config=config_mritter.js check=Work timer=30

1.If a path is not specified for the file, it will assume they are in the WPIScripts folder.

2.Paths can be full (starting with a drive letter) or relative to WPI.hta

(starting with '.\', '..\', or '\\').

3.Spaces are supported only if the path provided is properly quoted:

config="c:\space in\file path.js"

Link to comment
Share on other sites

OK I thought about it and dug a bit..

Try this:

{JSCRIPT}=if (getBits()==32) {FILECOPY} "Source\Filename.ext" "%ProgramFiles%\Foldername\password.bin"

In your commandline

Edit= Doesn't fully work, will have to ask mritter for help...

Edited by Kelsenellenelvian
Link to comment
Share on other sites

Ok, I tried several things and I think we're pretty close. Using either of these work great:

{JSCRIPT}=if (getArch()=="x86") RunCmd("notepad.exe",true)

{JSCRIPT}=if (getArch()=="x64") alert("x64!")

But this one does not:

{JSCRIPT}=if (getArch()=="x86") {FILECOPY} "%wpipath%\Install\File.dll" "%userprofile%\Desktop\Test\"

Mritter or anybody else have a solution?

Link to comment
Share on other sites

After some testing, getBits() will be easier for you: getBits()==32 or getBits()==64


{JSCRIPT}=(if getBits()==32) RunCmd('cmd /c copy /y "C:\WPI\ChangeLog.txt" "C:\"',true,false)

There are single quotes, ' , before cmd and after last " in the C:\ path.

Copy and paste this into the CONFIG WIZARD, ***not***directly into your config.js.

The cmd /c part may be optional. Try with and without it.

Edited by mritter
Link to comment
Share on other sites

Doesn't appear to matter if its true,false or just true. Also the code below doesn't work for me:


{JSCRIPT}=(if getBits()==32) RunCmd('cmd /c copy /y "C:\WPI\ChangeLog.txt" "C:\"',true,false)

It fails no matter how many different ways I try it. I just tried opening a cmd prompt and running the following and it copies the file just fine:

copy /y "C:\WPI\ChangeLog.txt" "C:\"

Link to comment
Share on other sites

Yes, need both the true and false at end.

Did you copy and paste it in to the Config Wizard or your config.js?

What does the install log file say?

Are you on a 32bit system or 64bit? Set it accordingly.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...