Desktop Enginnering

VBscript Permission Denied 800A0046 Solution

I was helping a friend write some VBscript the other day. I was trying to write a simple copy function and I kept getting permission denied. However I was logged in locally as the administrator so that could not be it.

My code looked something like:

Sub CopyFile(source, destination)
	set filesys=CreateObject("Scripting.FileSystemObject")
	If filesys.FileExists(source) Then
	   filesys.CopyFile source, destination
	End If

End Sub

The Solution is: add “\” add the end of any of your path names like
Dim destinationpath
destinationpath = “C:\” & myfolder & “\”

Hope this helps someone else.

Tags: , , , , , , ,

Friday, June 26th, 2009 Desktop Enginnering, Programming 2 Comments

Custom Free Silent LogMeIn Installer.

So there are already a few guides out there on how to make a Silent(In the sense that it don’t ask you for your username and password) LogMeIn installer. I am going to show you the way I do it with step by step instructions so that anyone can follow.  This tutorial will be broken into two parts. Part 1 is for customizing the LogMeIn installer. The second part is for making your own. Disclaimer this tutorial is for educational purposes only.

Part 1 - Customizing the Installer:

Last updatede on September 17, 2009 to reflect the newest version of LogMeIn version 4.0.0.966 (Sep 5 2009)

Get the tools that you will need to complete this job:

Download Orca – Orca is a MSI editor. It allows you to change the title and text of any MSI installer.
LogMeIn.com – Log into your LogMeIn account and download the installer. 

Download me in installer to a folder on your desktop. Make a copy and name it LogMeInClean.msi incase you corrupt your installer and have to restart.

Step 1: Edit the OnInstallExecuteSequence Table:

Find the installer you just downloaded and right click on it and select “Edit with Orca”

Find InstallExecuteSequence under the table list on the left hand side, then do the following: 

  1. Select GetDeployInfo under the action list. 
    Change: UILevel=2 AND UPGRADEPRODUCT<>1 AND InstallMode<>”Remove”
    into: UPGRADEPRODUCT<>1 AND InstallMode<>”Remove”         

  2. Right click on the right panel and select “Add Row”:
    ACTION: GetLMIRegistrationCookie
    CONDITION: NOT Installed
    SEQUENCE: 3710         

  3. Right click on the right panel and select “Add Row”:
    ACTION: LMIGetLicense
    CONDITION: NOT Installed
    SEQUENCE: 3730         

  4. Select CreateUser under the action list. 
    Change: CANCREATEUSER AND PASSWORDSOK=”true” AND VersionNT AND REMOVE<>”ALL”
    into: VersionNT AND REMOVE<>”ALL”         

  5. Select CreateUserSetProperty under the action list. 
    Change: CANCREATEUSER AND PASSWORDSOK=”true” AND VersionNT AND REMOVE<>”ALL”
    into: VersionNT AND REMOVE<>”ALL”         

  6. Right click on SetX64Path and select “Drop Row”
    Right click on SetX86Path and select “Drop Row”

Find Property under the table list on the left hand side, then do the following: under the table list on the left hand side, then do the following: 

  1. Select LICENSETYPE under the action list.”
    Change: 5
    into: 0       
  2.  Right click on DEPLOYID and select “Drop Row” Important note, since installers can be reversed make a LogMeIn account which only has the ability to add computers, then move them out of that user’s name.  Once they are installed. Use this account for the following steps.  To make an account login to your LogMeIn account and click users on the left hand side. Then add a new Administrator, and give that account the ability to Deploy Computers. When a new computer is added you will want to edit that user and remove rights to that computer if you choose to do it this way.
     
  3. Right click on the right panel and select “Add Row”:
    property: USEREMAIL
    value: Your account’s email address  

  4. Right click o n the right panel and select “Add Row”:
    property:USERWEBPASSWORD
    value: Your account’s web login password
         

  5. Right click on the right panel and select “Add Row”:
    propertyUSERPASSWORD
    value: Password if no windows password present         

  6. Right click on the right panel and select “Add Row”:
    property: USERVERIFYPWD
    value: Password if no windows password present If you need to configure LogMeIn for a proxy look for the proxy settings in the action list.       

     

Then in Orca click File then Save. Make sure you do save and not save as, this is because Orca only saves the different changes, if you notice you have a tiny file like .5mb then you did it wrong. 

  

Part 2 – Making the Installer:

Get the tools that you will need to complete this job:

Download Inno SetupInno Setup is a free installer for Windows programs. 

Download the Setup Kit – A simple kit I have put together for you to create a custom installer. Change the images to meet your needs.
That is it, make sure you leave your comments.

 

Most of this information came from http://www.msfn.org/ by writting this post I hope to save you from digging through 8 pages of post, and give you the most relavent information for the newest version of LogMeIn.

 
Edit:
08/02/09:
Thank you Dale for pointing out a spelling mistake and an error.

Tags: , , , ,

Overwriting an Excel file destination using SSIS

This was a problem I racked my brains over for a while when I first started using SSIS. I found a few possible including using a File System task to copy a “Template” Excel file over the existing on, or generating unique files by appending the date.  I simply wanted to overwrite the existing data just like the Flat File Destination gives you that option.

My work around was as flows:

Create the Data flow the way you normally would, then go to the Control View Then add two Execute SQL Tasks before your data flow is called so it looks like this

Step 1: Add Execute SQL Task 1 to Control Flow

Step 1: Add Execute SQL Task 1 to Control Flow

Set both Execute SQL Tasks to use the Excel file

Step 2: Set Connection Manager

Step 2: Set Connection Manager

Set your first Execute SQL Task’s SQL Command drop your table which is also known as the sheet name of your Excel file.

Step 3: Drop Table

Step 3: Drop Table

Repeat step 3 on the second Execute SQL Command this time create your tables.

That’s it. Good luck.

Tags: , , , ,

C# .NET and LyricWiki to lookup lyrics

Music is everywhere with today’s high speed internet is most home it is no wonder that music is even moving to the World Wide Web. Many radio stations allow you to stream their stations over the internet. Many websites have been developed around music, like www.jango.com, www.pandora.com, and www.last.fm. I recently released my second version of Jango Desktop and one of the features I implemented was the ability to look up lyrics. Before I started I was thinking about all the ways I could parse the lyrics out of an existing lyric’s websites database. During my searching I stumbled upon http://lyricwiki.org/. Here is a small description of LyricWiki from the website:

LyricWiki is a free site which is a source where anyone can go to get reliable lyrics for any song, from any artist, without being hammered by invasive ads.

At this point you are probably thinking to yourself the same thing I did “Great, but where do I start?” So today I am writing a step by step tutorial on how to use Lyric wiki in your .NET program.

Creating a simple lyric demo program:

Step 1 Create the Form

Step 1: Create the Form

Open visual studio and setup your form to look similar to mine.

Adding the web service:

Because LyricWiki offers a web service, you will want to add it to your program as a web reference. Right click on your solution and select add a web reference, or in .net 3.5 add a service reference -> then go to advance and add a web reference. The service’s URL is http://lyricwiki.org/server.php?wsdl you will want to add it like below if you press go you should see the available methods.

Adding a Web Reference

Adding a Web Reference

Writing the code:

Double click on your button on the form and let’s right some code to handle the lookup.

Add this to the top of your code:


using LyricsLookup.org.lyricwiki;

Then add this to the button clicked method:


private void LyricsButton_Click(object sender, EventArgs e)

{

LyricWiki wiki = new LyricWiki();

LyricsResult result;

string artist = artistTextBox.Text;

string song =   SongTextBox.Text;

if(wiki.checkSongExists(artist,song))

{

result = wiki.getSong(artist, song);

Encoding iso8859 = Encoding.GetEncoding("ISO-8859-1");

LyricsRichTextBox.Text = Encoding.UTF8.GetString(iso8859.GetBytes(result.lyrics));

}else{

StatusLabel.Text = "Lyrics not found in database";

}

}

Then run and test.

Download the full solution of LyricsLookup

Tags: , , ,