Jump to content

i want to create a program and i need help


maniaq

Recommended Posts

hi, i don't know if i'm writing in right section, but i need help.

first of all i know how create a program that copies all needed files to some place i want (with installshield) but then i face up some problems:

first of all i have a .bat file that should be launched when i install the program and inside that file a have many lines with this line

"I386 source"
which i want change during my program installation, something like this:

i want to locate windows source I386 folder and i want that "I386 source" would be changed to it, for egzample

from this

"I386 source"

to this

E:\Atomix\XP\XP\I386

insise that .bat file (maybe there is an easier way).

how could i do that? :}:huh::unsure:

Edited by maniaq
Link to comment
Share on other sites


copy and paste these lines into a file called source.bat:

@ECHO off

IF NOT [%1]==[] goto start

ECHO.
ECHO no command line argument passed.
ECHO.

GOTO :eof

:start

ECHO argument passed = %1

after that if for instance you ran source.bat d:\i386 the %1 variable would equal d:\i386, try the example for yourself.

you can also set your own variables within the .bat code using set.

for instance:

set test=this is a test

later in your code %test% would equal this is a test

Edited by ophiel
Link to comment
Share on other sites

i don't understand why you would want to replace a line in a batch script. it would require patching the file and kind of negates the simplicity of a batch file.

i sometimes have a batch file create another batch file via echo > file.txt, perhaps that would be a better solution than trying to patch an existing script?

Link to comment
Share on other sites

copy and paste these lines into a file called source.bat:

@ECHO off

IF NOT [%1]==[] goto start

ECHO.
ECHO no command line argument passed.
ECHO.

GOTO :eof

:start

ECHO argument passed = %1

after that if for instance you ran source.bat d:\i386 the %1 variable would equal d:\i386, try the example for yourself.

you can also set your own variables within the .bat code using set.

for instance:

set test=this is a test

later in your code %test% would equal this is a test

thanks i have tested and it worked :lol:

Link to comment
Share on other sites

the next problem that i'm faced up is i don't know how to call cmd automatically when i extract files...

first when i add files (included a .bat file) to sfx archive i select what file to run after extract and here i stop...

i want to add a line for egzample "source.bat d:\i386" in command promt (when the files are beeing extracted). the reason i ask is because win xp source folder always changes. so is there any way i could do that? tnx :P

Link to comment
Share on other sites

instead of making a self-extracting archive, i would recommend using makecab to create a .cab archive of your files.

then afterwards you would use a batch script like this to decompress:

@echo off
expand myfiles.cab %1

if the script was named filecopy.bat, you would call it like this: filecopy.bat d:\i386

note: expand and makecab are microsoft utilities that come with xp

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...