User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the VB.NET section within the Software Development category of DaniWeb, a massive community of 397,837 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,583 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our VB.NET advertiser:
Views: 498 | Replies: 11
Reply
Join Date: Mar 2008
Posts: 6
Reputation: Maffyx is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Maffyx Maffyx is offline Offline
Newbie Poster

Compiling Questions

  #1  
May 29th, 2008
I have two questsions.

The first being is it possible in VB to have a user input information during the file setup and have that information be used in the source code, then compiled, and then used after the setup is complete?

Say I want to have the user input their name, the user does and when the setup is complete and he/she opens the end result program their name appears as the title of the form.

Question number 2.

Is it possible to have a program, recreate itself with another name? So it's sort of like a name change?

Like say I have name1 and when I click on the .exe it will copy itself and make name2 or randomly generated letters or numbers.

Any help is appreciated.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Feb 2008
Posts: 9
Reputation: dexblack is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
dexblack dexblack is offline Offline
Newbie Poster

Re: Compiling Questions

  #2  
May 29th, 2008
You don't need to do this at install time, try coding the application to check for the configuration at start up and ask if not found.
You have two easy choices for Q1 Store the configuration in the registry or a configuraiton file.
VB has a simple API for storing application information in the registry.
Q2. Get the path to your program (e.g. using App.Path), and copy it to the new name. (e.g. FileCopy source, dest) if FileCopy doesn't work it's because the program itself is locking the file.
Alternative are:
Dim fso As New FileSystemObject
fso.CopyFile source, dest
or try using the Windows API function CopyFile.
Declare Function CopyFile Lib "kernel32" Alias "CopyFileA" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String, ByVal bFailIfExists As Long) As Long
or in VB.NET
System.IO.File.Copy
Reply With Quote  
Join Date: Feb 2008
Posts: 9
Reputation: dexblack is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
dexblack dexblack is offline Offline
Newbie Poster

Re: Compiling Questions

  #3  
May 29th, 2008
I hope you're not trying to write a replicating virus program in VB ;-)
Reply With Quote  
Join Date: Mar 2008
Posts: 6
Reputation: Maffyx is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Maffyx Maffyx is offline Offline
Newbie Poster

Re: Compiling Questions

  #4  
May 29th, 2008
Alright I'll try those things out and see how it goes. Thanks!
Reply With Quote  
Join Date: Mar 2008
Posts: 6
Reputation: Maffyx is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Maffyx Maffyx is offline Offline
Newbie Poster

Re: Compiling Questions

  #5  
May 29th, 2008
Originally Posted by dexblack View Post
I hope you're not trying to write a replicating virus program in VB ;-)

No the second one was for future programs, the idea is to be undetectable by a pc games anti cheating system thing.
Reply With Quote  
Join Date: Mar 2008
Posts: 6
Reputation: Maffyx is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Maffyx Maffyx is offline Offline
Newbie Poster

Re: Compiling Questions

  #6  
May 29th, 2008
Hmm, alright I was looking at your options for question one, and I want to have it be able to be released, and let people enter in custom data to be hard coded in, and then work w/ the program.
Reply With Quote  
Join Date: Feb 2008
Posts: 9
Reputation: dexblack is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
dexblack dexblack is offline Offline
Newbie Poster

Re: Compiling Questions

  #7  
May 29th, 2008
If you insisit on customising via the installer your work will be harder and the program won't cope if someone deletes the configuration. You will still need to write the same code within the program so it is simplyt easier to do it in one place anyway.
Reply With Quote  
Join Date: Feb 2008
Posts: 9
Reputation: dexblack is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
dexblack dexblack is offline Offline
Newbie Poster

Re: Compiling Questions

  #8  
May 29th, 2008
You could choose to write the code in a DLL which is used by both the installer and your program thus preserving the one definition rule (ODR)
Reply With Quote  
Join Date: Mar 2008
Posts: 6
Reputation: Maffyx is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Maffyx Maffyx is offline Offline
Newbie Poster

Re: Compiling Questions

  #9  
May 29th, 2008
I guess, I have no experience in making those, but I might not be explaining my purpose well enough. I want the program to have information put in on setup, or possibly make a program that compiles a set of code with said input data. Is this possible?
Reply With Quote  
Join Date: Dec 2006
Location: United States
Posts: 612
Reputation: binoj_daniel is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 14
binoj_daniel's Avatar
binoj_daniel binoj_daniel is offline Offline
DaniWeb Expert

Re: Compiling Questions

  #10  
Jun 2nd, 2008
I went through what others have suggested, I think dexblack is pretty close.

First of all why would you distribute your application in the form of source code? Anyone can reuse it in that case.
Now, coming back to your question, yes both your questions are pretty much doable.
For First, you can go with storing the application settings in the config file and when the app launches it will reach from their, You can also use an encrypted registry key if you want to be in stealth mode.
For your second question, to achive the app rename feature you have to create a worker exe which will take care of this. Now, what is your criteria to rename the app? Is it one time or some other frequency?
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb VB.NET Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the VB.NET Forum

All times are GMT -4. The time now is 7:40 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC