Is there any way to launch default browser from intallshield after completing installation?
I followed installshield 2008 how to open url when install sucessfully completes. but did not understand how to do it.
Do we have any elegant way to do it?
Yes.
Here is what is needed to be done.
Write a batch file or vbscript that opens the url you want.
Convert that bat file into an exe using any of the converters available.
Call that exe via custom action.
Schedule that custom action after installation completes. i.e. After='InstallFinalize'.
You may also want to detect the default browser which you can do by googling the registry key.
The easiest way to do what you want would be to create the custom action as he said and go to the finish button and add action, choose your custom action and add the condition "NOT INSTALLED", so it only runs when it is installed and not for example while unisntalling.
Here is some sample code.
Dim iURL As String
Dim objShell
iURL = "www.happycat.com"
objShell = CreateObject("Shell.Application")
objShell.ShellExecute("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe", iURL, "", "", 1)
Related
I found how to make this
Download_Example
I have a question about how to make execute VBS in vb6 (VBS haves form3 (from vb6 project .)show)
I made a dialog with Microsoft common dialog control 6.0
CommonDialog1.Filter = "File (*.vbs)|*.txt|All Files (*.*)|*.*"
CommonDialog1.DefaultExt = "vbs"
CommonDialog1.DialogTitle = "Select File"
CommonDialog1.ShowOpen
The FileName property gives you the variable you need to use
A work-around might be just executing the script using Shell.
Shell "wscript.exe c:\myscript.vbs", vbNormalFocus
Shell "wscript.exe " & CommonDialog1.FileName, vbNormalFocus
See Microsoft's wscript documentation.
vbNormalFocus is there to restore focus to your vb6 program. It is optional but you probably want it. See documentation.
Looks like you are trying to run a VBScript from your VB6 app to open a dialog in the VB6 app.
VB6 -> VBScript -> Same VB6
You cannot do this with Shell since it runs the script as a separate process. The Script does not know what Form3 is because it is a component of the VB6 app and would not exist as a separate entity once the app is compiled.
Edit: Looks like what you want to do is possible but with Microsoft Script Control. Here are a few examples. Thank you #GSerg for pointing this out.
This or this might be used as a work-around but I don't think it is the right way to go.
Go back to your requirements. What exactly are you trying to accomplish? There has to be a better way.
I need to access folder on a SharePoint using VBA however the SharePoint requires Windows credentials and I do not want to map to a network drive.
When I run the code initially I get a 'path not found' error. If I open the SharePoint location in Windows Explorer it asks for my login, then when I go back to VBA the code works. I don't want to have to paste the file location into Windows Explorer every time I run it.
The code looks something like this:
Set FSO = CreateObject("scripting.FileSystemObject")
Set myFolder = FSO.GetFolder("\\this.location\foo\bar")
Is there any way to make VBA realise the path does actually exist and to prompt for the user's credentials?
Thanks.
Is there some way I can programmatically (in VBS) OR by using CMD/RUN open the 'Open' dialog that contains the places bar and a browser but without opening say notepad or MSpaint?
http://i.technet.microsoft.com/dynimg/IC354177.jpg
I'd like to use this on the desktop itself, it would be really cool if there was a DLL I can just use instead of having a VBS file but if not i'm sure its possible in VBS.
I'm busy searching where the actual open dialog box comes from, it should come from some DLL file somewhere.
I might even consider stopping the windows shell from opening all together and just using this open window as the shell on some computers.
Regards, Rocklore
What version of Windows are you on?
"UserAccounts.CommonDialog" was the way to do this in XP. But it no longer exists in Windows 7. You may be able to use some of the flags available for the BrowseForFolder() method to make it look like a file open dialog. See this page for an example.
XP Edit:
Here's an XP example using UserAccounts.CommonDialog.
With CreateObject("UserAccounts.CommonDialog")
.InitialDir = CreateObject("WScript.Shell").SpecialFolders("Desktop")
.Filter = "All Files|*.*"
' Show the dialog. If [Open] is clicked, save the name of the selected file...
If .ShowOpen Then strFile = .FileName
End With
Is there a way to minimize all windows automatically when launching an application?
I tried to call a .vbs file with the content above:
Set shell = wscript.CreateObject("Shell.Application")
Shell.MinimizeAll
But doing this, application is minimized too.
I'm not sure if this minimizes the windows, but it will probably satisfy your requirement:
set objShell = CreateObject("shell.application")
objShell.ToggleDesktop
This is equivalent to clicking the show desktop button.
Or as just extending your code:
shell.ToggleDesktop
Edit: Nevermind... this does the same thing as your code above. But why not just run this and then display your window? For instance, if it is your app... call the vbs and then display the window. Or if you have no control over the app, call it from a .bat file and run this vbs then your program.
What you want to do is first minimize all applications or toggle the desktop; THEN (perhaps even after a delay) open your application.
Is there any way to make a .vbs file Read only,so that no one rather a specific person can read the content or change the content? But only can double click on that file to start its execution. I will set up a Main.vbs into which I would put the below
Dim oShell : Set oShell = WScript.CreateObject ("WScript.Shell")
oShell.run "A.VBS", 1, True
oShell.run "B.VBS", 1, True
oShell.run "C.VBS", 1, True
oShell.run "D.VBS", 1, True
The user will click only on the main.vbs to start the execution. All the .vbs I want to be Read/write protected. is my thought possible in practice?
Thanks,
If you can't read it you can't run it.
You can set permissions so that no other person (except administrators) can change the file, but you can't prevent people from being able to read the file if they're supposed to be able to run it.
Some other options to consider. The script can be encoded with the Microsoft Script Encoder. This will make it unreadable. One download link here (can't find the official Microsoft download link) http://www.softpedia.com/get/Programming/Packers-Crypters-Protectors/Microsoft-Script-Encoder.shtml. Of course, it is possible for people to decode the file using the appropriate tool.
Another option is to digitally sign the script with a code-signing certificate. This will still allow it to be viewed, but it will not be able to be modified without breaking the digital signature.
Or even encode the script then digitally sign it.
If the purpose of this is to protect your code, then you can always make an executable file.