|
VB6 Setup does not support this functionality. However, the source code is also in VB6 and is easily modified. You can find the source code of the setup in the folder:
\Program Files\Microsoft Visual Studio\VB98\Wizards\Setup1
Basically what you do is modify the Setup1 program to search for the program's registry key, usually found under:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Program Name
If the program is installed, launch a new process with the uninstall parameters found in the registry. Use the CreateProcess API and wait until the uninstall ends. Then continue the setup.
Robert
|
|
|
|
|
Thanx for responsing sir,
i opened the project and check there that if the folder exist in the program file then this will call the exit module of the project.
i complete the modifications but i am not able to execute the project directly to create the exe file.
while deployment it take the setup1.exe file which is outside the setup1 folder as you told.
how can i run the modified setup1 project and create a exe file of that so that i can use that exe file while deployment.
please reply ASAP..
Thanx again..
Gagan Deep Singla
Chandigarh - INDIA
|
|
|
|
|
One way to do this is to compile the modified setup1 project to create a new Setup1.exe. Copy the compiled Setup1.exe into the folder named "PDwizard". The P& D wizard includes the version of Setup1.exe found in this folder.
The problem with doing this is that you probably do not want to use the modified version in all your setups, so you have to remember to save the old Setup1.exe and switch the two files again when you are done.
A better approach is to rebuild the CAB file with the modified Setup1 exe. You can include a different version of Setup1 in a CAB by copying the new Setup1.exe into the project specific Support folder, and rebuilding the cab using the batch file automatically created by the wizard for building the project CAB file.
Robert
|
|
|
|
|
hello sir,
you are not giving me the solution of my problem.
my problem is how to compile the modified setup1 project. when i compile this project this will give error.
error is not in the changes which i have made. it needs some predefined variable values, which i am not able to provide.
please tell me how to compile the setup1 project. rest every thing i know that how to use the new compiled setup1.exe.
i am again repeating that i want to know just how to compile the setup1 project. please try it on ur own pc without any change in it then u will find my situation.
thanx for responsing me..
Gagan Deep Singla
Chandigarh - INDIA
|
|
|
|
|
It compiles correctly on my pc as is. On the Project Properties screen, under the Make tab, you need to add the following Conditional Compilation Argument:
LOGGING = -1 : SMS = 0
There are also a number of C++ files that must be in the application folder, but those should all be there. The non-VB files required are:
COMMONRC.H
COMMONRC.RC
SETUP1.RES
SETUPRES.H
VBSHELL.ODL
VBSHELL.TLB
Other than that, without a specific error message I cannot offer any other suggestions.
Robert
|
|
|
|
|
All the conditions which you have wrote are already there. i am having the statemant LOGGING = -1 : SMS = 0 at appropriate place as you told.
All files which you are specifing are also present in the same folder as in the setup1.vbp.
Error Message is:
Application removal logfile 'c:\winnt\st6unst.001' not found. Unable to continue.
How can it find the file because there is not folder in C of Winnt. i have installed the Win-XP and it has the Windows folder in the C drive.
This error message comes in the ProcessCommandLine function of the bassetup1(setup1.bas) when called in Form_Load of Frmsetup1(setup1.frm).
please find if you can trace the error....
thanx for communicating me..
bye
Gagan Deep Singla
Chandigarh - INDIA
|
|
|
|
|
OK, just to clarify things - this is not a problem with compiling the Setup1.exe, but rather a problem that occurs when trying to step through the Setup1.vbp in the IDE.
What happens when you actually run a setup is that the setup.exe bootstrapper does some preliminary system setup before it calls Setup1.exe, and it also passes in a command line. The setup.exe moves the .CAB file to the Windows directory, extracts the st6unst.exe and Setup.Lst files to the Windows directory, and creates a new uninstall log (st6unst.00n) file in the Windows directory. Then it creates a command line with the file locations as parameters.
In order to run Setup1 by itself in debug mode, you must first manually perform the same steps that the bootstrapper ordinarily does to prepare the setup to run.
1)Make sure the file st6unst.exe exists in the C:\WINNT folder. If it does not copy the file to the folder.
2)Copy the Setup.LST file for the package to C:\WINNT.
3)Copy the .CAB file for the package to C:\WINNT.
4)Create a text file with notepad, save it as C:\WINNT\st6unst.001, and add the following lines of text:
NOTE: Beginning of the bootstrapper section
CONFIG:
Title: [insert your application name here]
5)In the make tab of the Setup1.vbp project, add the required command line:
"C:\WINNT" "C:\WINNT\st6unst.001" "C:\WINNT\st6unst.exe"
The command line arguments MUST include the quotes, and each must be separated by exactly ONE blank space.
You can now run in the IDE.
HOWEVER, make sure you save all your work before trying to debug Setup1.vbp in the IDE. The Setup1 project makes some API calls that will crash the IDE and may completely lock up your machine. At best you will lose the VB6 IDE and at worst you will have to cold reboot yourt machine.
Robert
|
|
|
|
|
how can i create a new table in sql server database by visual basic command
|
|
|
|
|
|
CREATE TABLE table_name
(
column_one varchar(25),
column_two varchar(20),
column_three int,
column_four int
)
|
|
|
|
|
I want to be able to print all of the property settings to all of my forms so I dont have to go back and forth from project to project. I cant remember how I set things.
gcody
|
|
|
|
|
You could just print the code for it. Look in the Region labeled "Windows Forms Designer generated code". You'll find all the properties that are not set to default values listed in there.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Does anyone know how to change the startup form in a windows app??
|
|
|
|
|
nevermind, i was being lazy.
Now, does anyone know how to close one form when you open another?
|
|
|
|
|
I take your trying to show a splash screen? You can't transfer control of the application from one form to another. Once the startup form closes, so does your entire application. Search the articles for "Splash screen", you'll find a bunch of them describing the technique.
To answer your generic question, you can't. If Form1 opens Form2, Form1 must stay alive until Form2 is done. If Form1 closes, Form2 is destroyed with it. You can .Hide Form1 though.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
me.Form2.ShowDialog();
me.Form1.Hide();
|
|
|
|
|
Are you creating an MDI application?
poneill@neohop.com
Neohop Software
www.neohop.com
|
|
|
|
|
I want to make a program that can modify the display of a form and will have the code pause while it is waiting for the user to click the Next button.
I could easily have the Next button do the work, but I want this to work similar to the Form.ShowDialog function. What I'm looking for is a way that a main module will be able to display this form, show the user some data, and then decide what to show the user next depending upon what the user does.
What I'm looking for is a way to do this...
If Form.Prompt("First window") = "Something" Then
Form.Prompt("Second window")
Else
Form.Prompt("Something else")
End If
Each Form.Prompt function would be like InputBox or Form.ShowDialog, except that the form in question never disapears. The user clicks the Next button, which triggers the Prompt function to return a specific value.
But, finally, what I cannot figure out is how to pause the Prompt function to wait for the user to click the Next button. I'm using VB.Net 2003, and I'm hoping for something like Application.Pause, and I can have the OnClick function for the Next button run Application.UnPause... unforntunately, neither function exists. What can I do instead?
Reed
|
|
|
|
|
Your code should move on in response to the event fired when the next button is pressed. Add an onclick handler for your next button, and move to the next window in there.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
But is there a way to have the function not return a value until the user clicks a button? Like for the Msgbox function, nothing happens until the user presses a button. I want to mimick that feature, except that I do not want the window's closing to return the function... I want the button click to do that:
Function Prompt()<br />
' Do something<br />
Application.Pause<br />
' Process return<br />
Return something<br />
End function<br />
Sub btnNext_click()<br />
Application.UnPause<br />
End Subz
Reedmon29
|
|
|
|
|
You can create a new Form and call ShowDialog() . Calling ShowDialog() instead of Show() will pause the program until user closes the new form.
|
|
|
|
|
Exaclty. But, I don't want the form to close. I want the code to unpause when the user clicks the Next button.
I could have the form close, but I would then have to process everything again and display it immediately afterwards, and that seems to be a very bad idea.
Reedmon29
|
|
|
|
|
I haven't tried doing what you need but here are some ideas that I hope they work.
You need to create custom events to pause and continue in one form and subscribe your main form to those events.
Example to create event:
<br />
Public Event PauseCode()<br />
Public Event ContinueCode()
You create this event in the form that will be controlling the pause/continue events.
Example to raise event:
<br />
RaiseEvent PauseCode() or RaiseEvent ContinueCode()
Let's call the form with events defined above ControlForm
Now in your main form you will create the ControlForm and you have to declare the methods that need to be called when events are raised.
Example to handle the PauseCode event:
<br />
AddHandler _controlForm.PauseCode, AddressOf OnPauseCode<br />
AddHandler _controlForm.ContinueCode, AddressOf OnContinueCode
Next thing you have to do is create the OnPauseCode and OnContinueCode subs in your main form. First you need to create a boolean variable such as _isPaused. Then the OnPauseCode should something like:
<br />
private Sub OnPauseCode<br />
_isPaused=true<br />
while _isPaused do nothing<br />
end while<br />
end sub
And the only thing that the sub OnContinueCode does is to change the variable _isPaused to false.
Let me know if it works, I could use probably use it.
|
|
|
|
|
That works... I had the Do Nothing while loop run Application.DoEvents(), because otherwise the forms would not draw.
Thank you very much for your help.
Reedmon29
|
|
|
|
|
You'r code can't "pause" while waiting for the Next button to be clicked. If it did, there's no way it could respond to the button click.
If your code is supposed to modify the form layout between "Next" button clicks, like a PowerPoint presentation, you'll have to maintain state information about what "page" the user is looking at. Code in the click handler for the "Next" button would have to increment the counter to the next page and call a function to modify the controls according to what page should be viewed.
When you get to the last page, the "Finish" button click handler would set the forms return value, its .DialogResult property, to whatever you need. BTW, you'd show this form using .ShowDialog() so you can get a return value, just like MessageBox returns.
This is what I've gathered your trying to get at. I really can't tell for sure because you haven't been very descriptive about what your trying to do with this form besides "pause" code and handle a "Next" button.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|