tslewis
Posts: 65
Joined: Wed Mar 13, 2013 7:06 am

Custom Action Error 1001; CRAZY - Requiring a blank space

After three weeks of debugging, I have found the source of my error. It is related to these two articles. I had to include an extra space after the Installer Parameter when passing a property to an action for a custom action using an installed ,NET installer class.

http://www.advancedinstaller.com/forums ... f=2&t=7886

http://blogs.msdn.com/b/vsnetsetup/arch ... ation.aspx

Why on earth is this the case?

I have a parameter [FOLDER_PATH] which is the name of a Search value used by Advanced Installer to get the value of folder path assigned to
the value of a key in the registry of the target computer.

I have tried assigning raw property value, value points to a folder, value points the path of a file. Neither of these effects anything.

Each time when I assign say an action to my custom action which is base on an installed .NET installer class DLL, and uses [FOLDER_PATH] I get the 1001 error documented by Microsoft above.

Luckily I saw someone had a similar issue, the solution is to simply add a space after [FOLDER_PATH] when assigning this to a custom action parameter of the Edit .NET Custom Action dialog.

Can someone please tell me why I have to do this? It seems nuts. And if it is obscure formatting issue, why when I explicitly changed the raw value of the registry key to path or file in the search GUI of AI it doesn't correct this formatting issue?

As an aside, I originally started the AI V10 project in VS2012 and added it to my solution. I then edited everything in the AI GUI and also built it form there. One thing I noted in VS2012 is I do initially get the error

The target "GetFrameworkPaths" does not exist in the project.

Which I did not get in an earlier version of AI. This message does go away when I build the solution in VS 2012

cheers
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Custom Action Error 1001; CRAZY - Requiring a blank spa

Hi,

Yes, this is explained here by us: http://www.advancedinstaller.com/user-g ... question60

The correct solution is indeed to add the blank space.

Usually when you receive these errors it is recommend to start searching our forums and FAQs area on the website, if debugging your code doesn't get you to a solution, there are a lot of solutions explained here.

Best regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
tslewis
Posts: 65
Joined: Wed Mar 13, 2013 7:06 am

Re: Custom Action Error 1001; CRAZY - Requiring a blank spa

thank you, I always earch through the forums, I got the error message 1001, the MSDN forums pointed me in the right direction when I used a search for this error. Suggest you also add this in your FAQ for potential cause of error 1001 with a .NET custom action
tslewis
Posts: 65
Joined: Wed Mar 13, 2013 7:06 am

Re: Custom Action Error 1001; CRAZY - Requiring a blank spa

Also, isnt teh point of having an option to choose between a raw value and a vlue that is afolder in the AI serach pane of the GUI when assigning a serach parmater to a registry vlaue supposed to solve this? It didnt for me.....
tslewis
Posts: 65
Joined: Wed Mar 13, 2013 7:06 am

Re: Custom Action Error 1001; CRAZY - Requiring a blank spa

Also, please cross check with anothe post I made regardng a VS2012 error. I think these issues are inter related


http://www.advancedinstaller.com/forums ... =2&t=23841

GetFrameWorkPath properrty

http://msdn.microsoft.com/en-us/library/ms164297.aspx

Based on your FAQ, you suggest this customaction error is due to framework mismatching. Hence why I think these are related.
tslewis
Posts: 65
Joined: Wed Mar 13, 2013 7:06 am

Re: Custom Action Error 1001; CRAZY - Requiring a blank spa

RIGHT

BEFORE DISMISSING THIS PROBLEM OFF WITH A TWO LINE SENTENCE REFERRING ME TO THE FAQ. PLEASE READ FIRST. AS TO BE HONEST, I HAVE WASTED ALNOST THREE WEEKS NOW CHASING UNRELATED SUGGESTED ISSUES.
BELIVE ME IT TAKES ME MORE TIME TO WRITE THIS THAN IT DOES FOR YOU TO READ IT.

THIS IS GETTING REAL PANFUL NOW.

NOW, I use the [APPDIR] parameter passed to my installed custom .NET action.

Get the error, below which in accordance with FAQ for error 2869, which is not the number I get so I don't know how I could have found this in the FAQ....

Error 1001 - see attached too much verbage to type here

NOW, as a test, I use the [APPDIR] AND a space parameter passed to my installed custom .NET action.

Get the Error
Error 1001, index was out of range. Must be non negative and less than the size of the collection. Parameter name : index

NOW, I use the [APPDIR]\ parameter passed to my installed custom .NET action. AS YOU REFER TO IN FAQ FOR ERROR NUMBER 2869 NOT 1001.

No ERROR but now bums out as the parameter is read with an extra \ I.e. C:\Programfiles\Program\\ so when using the string for this path in my code it screws up!!!!!

CAN YOU PLEASE EXPLAIN WHY SOMETIMES I NEED TO ADD A SPACE AFTER A PARAMETER TO STOP IT CRASHING, SOMETIMES I NEED TO ADD A \, SOMETIMES I NEED TO ADD A \ AND THEN TRIM THE STRING TO REMOVE THE EXTRA \ IN MY CODE? WHY CAN YOU NOT RESOLVE THESE ERRORS IN THE PROGRAM? ISNT THAT THE POINT OF PAYING 1000 bucks not to have these weird syntax issues I have to spend hours debugging? Ridiculous.

THESE ISSUES ARE NOT RETURNING COMMON ERRORS THAT ARE DOCUMETED IN YOUR FAQ, SO CANNOT BE SEARCHED FOR. HOW AM I SUPPOSED TO KNOW THIS?

THE FAQ for ERROR 2869 you keep saying to refer to in YOUR FAQ does not address this.

I am not running on a server, stand alone PC. hence why am I getting an extra \?

AGAIN, PLEASE CAN YOU REFER TO ME FRAMEWORK ERROR IM GETTING WITH VS2012 - see previous forum post. Is there a possible link to all these issues? I suggest you look at ASAP with AI V10 and VS2012

http://www.advancedinstaller.com/user-g ... question59

cheers
Attachments
2013-04-02_004213.png
2013-04-02_004213.png (20.34 KiB) Viewed 17239 times
tslewis
Posts: 65
Joined: Wed Mar 13, 2013 7:06 am

Re: Custom Action Error 1001; CRAZY - Requiring a blank spa

Bogdan wrote:Hi,

Yes, this is explained here by us: http://www.advancedinstaller.com/user-g ... question60

The correct solution is indeed to add the blank space.

Usually when you receive these errors it is recommend to start searching our forums and FAQs area on the website, if debugging your code doesn't get you to a solution, there are a lot of solutions explained here.

Best regards,
Bogdan
Please explain why the option of setting raw data value to a folder path in the search panel of AI GUI does not resolve this. What is the point of this?
tslewis
Posts: 65
Joined: Wed Mar 13, 2013 7:06 am

Re: Custom Action Error 1001; CRAZY - Requiring a blank spa

the reason of my concern is, when my installer gets more advanced, how on earth am I supposed to track where the bug is based on simple syntax isssues like an extra space, an extra \ or trimming my string? Especially when the error messages are never the same? How can I make my code future proof? You need to clarify this.
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Custom Action Error 1001; CRAZY - Requiring a blank spa

It seems my colleagues tried improve the error message received, as the one from before it was too cryptic. Before that no error message was included in the error, you had to create a verbose
log and there you could find the code 2869, as in this post for example:
http://www.advancedinstaller.com/forums ... 18&start=0

Tracking a problem from an installation package starts with creating the verbose log. If a custom fails then you need to first check
its settings against our user-guide and also check the error code (the one from the log) in the forums, see if anyone has encountered a similar problem.

If no solution is found the next step is to debug the code of your custom action.

Regarding the whitespace character\backslash workaround, we'll need to investigate why it fails for you to provide you with a proper answer. We'll post an update for this tomorrow.

Best regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
tslewis
Posts: 65
Joined: Wed Mar 13, 2013 7:06 am

Re: Custom Action Error 1001; CRAZY - Requiring a blank spa

Thank you for the response.

Please do provide me with an update,

cheers
tslewis
Posts: 65
Joined: Wed Mar 13, 2013 7:06 am

Re: Custom Action Error 1001; CRAZY - Requiring a blank spa

Please can someone get back to me on this?
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Custom Action Error 1001; CRAZY - Requiring a blank spa

Hi,

Sorry for the delayed reply, the colleague that handled the development for this support was not in the office for a couple of days last week.

The problem is that the errors that you see, most of them are given by the .NET framework, not from the installer. Sometimes the workaround we suggest might work, but not always.
There have been cases when the custom action had a problem in the code and the same error appeared, so we cannot always apply a fix programatically. Only when the custom action
runs it can be seen if the missing space/backslash generates an error.

The Installer Class API is very limited when it comes to error, giving very few details about the source of the problem. This leads to very confusing error messages, making it hard to debug the package.
Unfortunately for the moment the only solution to avoid the cryptic support from Installer Class is to migrate to another type of custom action, i.e. C++ or DTF custom actions (C# or VB.NET).

Regarding backslashes in the path received by the custom action, the API from the OS should be able to handled paths that contain two backslashes instead of one,
this is a common escape character mechanism used when defining a file/folder in path your code.

Best regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
tslewis
Posts: 65
Joined: Wed Mar 13, 2013 7:06 am

Re: Custom Action Error 1001; CRAZY - Requiring a blank spa

Ok, slowly getting the hang of this.

I see your point. Im using a DTF VB>NET CA now and it is WAYYYYYY simpler and better than using an Installer Class. I recommend you really state in bold - as you say that this class should be avoided. I would have saved so much time. I actually don't see the use of any other type of CA including java script and vbscript.

I have had zero syntax issues thus far and can access both WINDOWS INSTALLER properties and Advanced Installer properties within the custom action for an immediate action much easier than having to go through CustomActionData. Another advantage, I can attach the DTF DLL to the installer - I don't have to install it.
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Custom Action Error 1001; CRAZY - Requiring a blank spa

That is very good, just one thing to keep in mind. DTF, as Installer Class too, require the targeted version of .NET Framework, from your VS solution, to be installed on the machine
were the package runs. Make sure you set this as a launch condition for your package. Otherwise the custom action will fail to run.

Best regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”