im making an installation form in VB

-i already made the installer/setup for my project using another installer maker

im having a prob on the syntax, i just googled this and try it but have a error


Dim TaskID As Long
TaskID = Shell(App.Path \ CAIsetup.exe, vbNormalFocus)


my only guess is the file extension of "CAIsetup"
since the error is "object required" and the app.path is detected

CAIsetup:
Type of file : Application
Description : Setup Application
used Setup Factory on making this installer

======================

what extension shall i used???

Recommended Answers

All 7 Replies

do this...

Dim TaskID
TaskID = Shell(App.Path \ CAIsetup.exe, 1)

i already do that 1 to, same error,

'Declare TaskID without the AS BLAH

Dim TaskID '(As Long)

sir, i dnt know y, i knw what u say must work

but it still gives me the error

is a Setup Application = .exe file?

Dim TaskID As Long
TaskID = Shell(App.Path \ CAIsetup.exe, vbNormalFocus)

=====================

what extension shall i used???

there is no problem with the extension. your setup package is of course an self-executable file and like other exes' it also has an extension .exe . there is a mistake in your syntax.
try this out.

Shell(App.Path & "\CAIsetup.exe", vbNormalFocus)

else you can use an windows api function to execute this.

API Implementation :-
declare this api function at general section into your form :-
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

and this is your code :-
ShellExecute Me.hwnd, "Open",App.Path & "\CAIsetup.exe" , vbnullstring, vbnullstring, vbNormalFocus


think this helps.

regards
Shouvik

commented: thx again n again!! +1

WAAAAA!! soo thats whats been causing the errorm
:'(


thx sir, that error confused me soo,
cause of the "file not found error"


thx again!!!

you missed the double qoute("Caisetup.exe")...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.