|
Dear All,
I have 5 projects under a single solution and i am using VS 2k5. i have made a setup project which builds MSI file. every thing works fine.
I want to copy a file from a specific folder before installing my msi package and then delete that file after installation is successfull.
any ideas or suggestions please?
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
Any decent installer package will let you specify your own tasks and the order in which they occur. I have no idea about the ones that VS creates.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
It supports Custom Actions. Right click on the installer project and choose View -> Custom actions.
|
|
|
|
|
thanks for reply, as I mentioned before I have 5 projects in one solution. I put an Installer in one of those projects and I overrieded OnbeforeInstall and OnAfterInstall. I copy the files in "OnBeforeInstall" and when i restore that file again in "OnAfterInstall" that file is not populated again.
OnBefore Install works, but OnAfterInstall doesent work. I am getting no errors, nothing but I have simply wrote to move that file, but it doesent.
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
|
Thanks alot, helped me alot
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
You are Welcome
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
For example, my input was 1000042738 (doesn't matter this 10 number is integer or string type)
After encrypted, it will become an output of 10 byte length
something like this example >> 8273650283
and after decrypt it will back to 1000042738.
i do not know whether this is possible or not, because I'm still fresh to encryption
i already google for this kind of example for few days and i cant find a suitable one because all the example out there was 64bit encryption, which already exceed 10 digit length.
**my input length is always 10 and consist of numbers only
**output length must be 10 and consist of numbers only
btw, i do try xor which i think its not a good method.
because it gave me 8372400001 which reverse the original input.
thx alot guys!!!
|
|
|
|
|
wSheng87 wrote: because it gave me 8372400001 which reverse the original input.
That is what xor does.
If I were you, I'd look for encryption methods in the encryption namespace. If you MUST generate numbers, and they then convert back to numbers, you're greatly reducing the scope for an algorithm to be secure. It's possible you'd have to write your own for that, and expect that it is breakable.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
It really depends on how much security you need.
If you need a lot of security then you're not likely to be able to retain the 10-digit requirement.
If only a little security is need then maybe you don't need any at all.
Can you give more information?
Anyway... this may be an area where just a little security can go a long way; after all, how would someone who intercepts the message know he had correctly deciphered the number?
The following code is an example of a very simple/non-secure encription algorithm, similar to ROT13[^]:
private static readonly System.Collections.Generic.Dictionary<char,char> wombat ;
static Template
(
)
{
wombat = new System.Collections.Generic.Dictionary<char,char>() ;
wombat [ '0' ] = '9' ;
wombat [ '1' ] = '8' ;
wombat [ '2' ] = '7' ;
wombat [ '3' ] = '6' ;
wombat [ '4' ] = '5' ;
wombat [ '5' ] = '4' ;
wombat [ '6' ] = '3' ;
wombat [ '7' ] = '2' ;
wombat [ '8' ] = '1' ;
wombat [ '9' ] = '0' ;
return ;
}
private static string
Wombat
(
string s
)
{
System.Text.StringBuilder result = new System.Text.StringBuilder() ;
foreach ( char c in s )
{
if ( wombat.ContainsKey ( c ) )
{
result.Append ( wombat [ c ] ) ;
}
else
{
result.Append ( c ) ;
}
}
return ( result.ToString() ) ;
}
If more security is required, you could extend this to provide for passing a "key" between partners, but you would then need separate encription and decription methods.
|
|
|
|
|
for my case, i have P-1234-1000042373.
which i need to encrypt the final 10 digit into another integer combination.
which mean it still readable by human. because when user enter in this key, it should be numeric form and it is not suppose to be very long, or else user will feel ...
and maybe i gona encrypt all 14 digit which is 12341000042373 together into numeric form also..if possible
erm, if you can make one with the encrypted output not very long or short
something like 12-13 or 15-16 @_@
i appreciate ur reply..thx u so much
|
|
|
|
|
wSheng87 wrote: P-1234-1000042373.
wSheng87 wrote: encrypt the final 10 digit
A Regular Expression can be used to split them off.
|
|
|
|
|
I was practicing coping files in C# console application. I have only one execuitable and i am trying to copy that execuitable using File.Copy method inside that execuitable. I know this sounds stupid but can be done and if yes how.
|
|
|
|
|
Yep - add the following using statment
...
using System.IO;
...
then in your code do something like this:
...
File.Copy(@"C:\test.exe", @"C:\Temp\test.exe");
...
|
|
|
|
|
string str = "hai";
Console.WriteLine(str==str);
Console.WriteLine("Hello"+str==str);
Output:
True
False
Have doubt in second,... why did not print "Hello" and why print False instead of True
|
|
|
|
|
Hi,
you should check the documentation on operator precedence to find out whether
"Hello"+str==str is the same as "Hello"+(str==str)
or is the same as ("Hello"+str)==str
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Argh, beat me to it!
|
|
|
|
|
|
anishkannan wrote: why did not print "Hello" and why print False instead of True
I guess there's a common reason for...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
For Console.WriteLine(str==str);
here compiler checks "hai" is "hai" or not !!
Compiler : Yes
So your Console.WriteLine(str==str); is "True".
For Console.WriteLine("Hello"+str==str);
now the compiler checks is "Hellohai"(the outcome of "Hello"+str) is "hai".
"Hellohai" == "hai"
Compiler : no
So your Console.WriteLine("Hello"+str==str); is "False".
The key portion here is C# operator Precedence.
|
|
|
|
|
Hi,
I have configured the ASPNET membership database to use for security. I am planning on using Client Application Services with WinForms so that I may be able to have one UserID for the website and the Desktop App.
How can I check the UserId tag in the aspnet_Users table in order to populate a WinForm with information for the specific user?
Currently I have a PersonTable that has a One-To-One relationship with aspnet_users and the Person Table has a One-To-One relationship with the EmployeeTable and a One-To-One relationship with the ClientTable.
Thank you!
Illegal Operation
|
|
|
|
|
Illegal Operation wrote: How can I check the UserId tag in the aspnet_Users table in order to populate a WinForm with information for the specific user?
Are you able to do this from ASP.NET? If yes, best way is to create a web service which will use membership provider APIs. Your windows application can just call this service without messing with ASP.NET APIs.
|
|
|
|
|
What I need to do is reinsert all records exactly as they are from the backup table back into a new table in their corresponding fields.
I am sure there is a better way. The way I would go about doing this is passing a sql reader looping and reinserting the records from 1 table to the other. However this also mess's up the index on the new table.
The new table is structurally different but it has all the same fields as the orgional table, only different order, plus additional fields.
Any good Ideas on what the best way to tackle this? and keep the index's the same?
|
|
|
|
|
JollyMansArt wrote: What I need to do is reinsert all records exactly as they are from the backup table
Ask the question in the correct forum.
only two letters away from being an asset
|
|
|
|
|
debugged a code that calculated savings at 5,10 and 15% for 10, 20, 30, 40 years. The display showed the column heading/information of the percentages whereas the rows held the information for the years. Problem I am having is switching the display to show the years information in the columns and the percentages in the rows. Used a loop to do the first one can't figure out how to change the loop to reflect the other way.
|
|
|
|