Modify a *.pif from a C exe 
Author Message
 Modify a *.pif from a C exe

Folks,

For my work I am looking for the following:

1)      Create, is necessary, a folder on the desktop
2)      Create a shortcut in this folder.

With the shortcut a clipper program will be started.

The current install program which works only under DOS is written in C.

I would like to extend this C program with the 2 steps mentioned above.
For step 2 I am thinking of using a default shortcut at put this on the
install diskette.
The program should run on NT.

I am thinking of something like this in pseudo code.

if exists "c:\windows\desktop"
  if not exists "c:\windows\desktop\NewName"
    create "c:\windows\desktop\NewName"
  endif
  copy "a:\default.pif" to "c:\windows\desktop\NewName"
  modify ("c:\windows\desktop\NewName\default.pif")
else
  if exists "c:\windows\profiles\allusers\desktop"
    if not exists "c:\windows\profiles\allusers\desktop\NewName"
      create "c:\windows\profiles\allusers\desktop\NewName"
    endif
    copy "a:\default.pif" to
"c:\windows\profiles\allusers\desktop\NewName"
    modify ("c:\windows\profiles\allusers\desktop\NewName\default.pif")
  else
    display "error message"
  endif
endif

function modify(Filename)
  in "filename" change command line into "c:\Clipper\progname.exe"
                       working directory into "c:\Clipper|
                       icon into ......
return (true)

Please send me an example if this is possible.

thanks in advance.

--
name     : W.H. Magr

homepage : http://www.*-*-*.com/

When the future is current,
the current is the past



Sun, 28 Jan 2001 03:00:00 GMT  
 Modify a *.pif from a C exe

Quote:

> Folks,

> For my work I am looking for the following:

> 1) Create, is necessary, a folder on the desktop
> 2) Create a shortcut in this folder.

The standard C language (which is the sole topic of conversation in
comp.lang.c) has no concepts of `folders', `desktops', `shortcuts', etc.
Perhaps comp.os.ms-windows.programmer.win32 would be more helpful?

Quote:
> Please send me an example if this is possible.

No.  You post here, you read here.  Welcome to Usenet.

--



Mon, 29 Jan 2001 03:00:00 GMT  
 Modify a *.pif from a C exe

Quote:
> Folks,

> For my work I am looking for the following:

> 1) Create, is necessary, a folder on the desktop
> 2) Create a shortcut in this folder.

        [big snip]

<Jack>

As already pointed out, each and every one of the things you want to do uses a
function which is not part of the ANSI/ISO C language, despite Microsoft's
best efforts.  You have to use non-portable, platform specific extension
functions, best discussed on newsgroups for the platform.

Also...  Didn't your compiler come with a version of InstallShield to do
things like this?

</Jack>



Mon, 29 Jan 2001 03:00:00 GMT  
 Modify a *.pif from a C exe

Quote:

> if exists "c:\windows\desktop"

although your question is offtopic here, i warn you about the
code in the quoted line. Using dos-filenames in string-constants in "C"
has a big danger. "\w" is a "quoted w" . You should write
DOS-filenames as "c:\\windows\\desktop"

--
-----
Udo Klasmeier
SELST
ZIT/A5 tel 45477



Mon, 29 Jan 2001 03:00:00 GMT  
 Modify a *.pif from a C exe

|
|> if exists "c:\windows\desktop"
|
|although your question is offtopic here, i warn you about the
|code in the quoted line. Using dos-filenames in string-constants in "C"
|has a big danger. "\w" is a "quoted w" . You should write
|DOS-filenames as "c:\\windows\\desktop"
|

Since DOS and family and Unix and variants accept
"/windows/desktop", it is probably wise to adopt this single
form across those systems.  Of course, other systems use completely
different forms for directory structures, so do not be misled
into thinking that this "portability" is wider than that.



Mon, 29 Jan 2001 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. How to Modify and Recompile isolated aspx and cs files

2. Newbie: separate big .cs file into small .cs files

3. Self-modifying EXE file

4. HEAP[dllhost.exe]: HEAP: Free Heap block 1e32c28 modified at 1e32dc4 after it was freed

5. Modifying EXE after compiling

6. Programmatically modify the version info resource of exe?

7. Modify .EXE

8. Can we modify assembly.exe.config file

9. .PIF file for Borland DPMI DOS program

10. PIF for debugging console program?

11. Selecting PIF file with CFileDialog

12. WinExec("file.pif",SW_HIDE);

 

 
Powered by phpBB® Forum Software