7 Replies - 528 Views - Last Post: 13 January 2012 - 06:22 AM Rate Topic: -----

#1 crimsonK8  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 11-January 12

Windows app deployment so that executable can take parameters

Posted 11 January 2012 - 02:35 PM

I have created a Windows App autoupdater in VS 2010 and I need one part of the code to run invisibly on start up and then if I need to make admin changes I want the windows form to appear if I run the app at other times.

I decided the best thing to do would be to let the code decide where its being run from by using the args passed to Main..and use a shortcut in the startup folder with the arg for start up, and then be able to call the app from command line with another arg to bring up the admin part.

However, being very new to C#, in trying to deploy the app, there seems to be little choice but to use ClickOnce deployment and this does not seem to want to use arguments or be run from commandline.

I am wondering if anyone has any ideas about what I could do?? I have tested it all in Debug and it works fine..just the deploying of it in the way that I want is the problem.

Thanks to anyone that can help me.

Is This A Good Question/Topic? 0
  • +

Replies To: Windows app deployment so that executable can take parameters

#2 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2251
  • View blog
  • Posts: 9,435
  • Joined: 29-May 08

Re: Windows app deployment so that executable can take parameters

Posted 11 January 2012 - 02:38 PM

Your explanation, sounds like you doing something dodgy.
Was This Post Helpful? 1
  • +
  • -

#3 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5468
  • View blog
  • Posts: 11,749
  • Joined: 02-June 10

Re: Windows app deployment so that executable can take parameters

Posted 11 January 2012 - 02:45 PM

What do you mean by "code run invisibly" ?
Because all code that doesn't explicitly affect the GUI runs invisibly.

int x = 5;
for (int y = 0; y<x; y++)
{
   int z = y * x;
}


There is nothing there the use would see.

What do you mean by "where its being run from"?
If this is supposed to be an updater what difference does it make if it is run from CD, Web or USB stick?

Call the autoupdate app from commandline... What year do you think it is?

I agree with Adam, this has a very odd smell about it. Either you are doing something really dodgy or you are doing something with legitimate intent and really bad execution plan.
Was This Post Helpful? 0
  • +
  • -

#4 crimsonK8  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 11-January 12

Re: Windows app deployment so that executable can take parameters

Posted 13 January 2012 - 02:36 AM

Hi Guys...no not doing anything dodgy..but I think I have misunderstood something, used wrong terminology maybe (should be arguments to a .exe file) and I think in messing around with settings I have "corrupted" something. I used to write c++ on a unix platform so using windows seems kind of messy..and having a break of a few years my understanding of certain things has escaped me for a while. I am going back to basics so I actually see what can and can't be done in simple situations. Typical me..jump in at the deep end without understanding the basics. :) Thanks for your comments tho'.
Was This Post Helpful? 0
  • +
  • -

#5 cilaes  Icon User is offline

  • D.I.C Head

Reputation: 9
  • View blog
  • Posts: 75
  • Joined: 12-December 11

Re: Windows app deployment so that executable can take parameters

Posted 13 January 2012 - 03:12 AM

I thought at first the "code to run first at startup" would to be checking the version of the program vs. the newest and if it doesn't match show a new form... maybe im being optimistic?
Was This Post Helpful? 0
  • +
  • -

#6 crimsonK8  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 11-January 12

Re: Windows app deployment so that executable can take parameters

Posted 13 January 2012 - 04:30 AM

What I wanted was for the application to be installed on client machine and first thing when they log in to do some housekeeping if needed, so I wanted a shortcut in the Startup folder with an argument to say it was being run from there. They don't need to see this being executed. I then needed a way of bringing up the admin screen within the app if I need to change path names or run the housekeeping tasks at other times, one by one or in bulk. I think I can do what I want. I have never installed a c# app before and I tried using clickonce but I think I need to use the windows installer. I played with some settings I shouldn't have too and I think this created an error I wasn't expecting. Its all a bit new to me..but I will learn. Its just a bit frustrating as I have written a lovely app that works in VS I just need it deployed on peoples machines. The key is to read up properly!! :)
Was This Post Helpful? 0
  • +
  • -

#7 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6052
  • View blog
  • Posts: 23,487
  • Joined: 23-August 08

Re: Windows app deployment so that executable can take parameters

Posted 13 January 2012 - 04:31 AM

Quote

I have created a Windows App autoupdater in VS 2010 and I need one part of the code to run invisibly on start up and then if I need to make admin changes I want the windows form to appear if I run the app at other times.


This sounds like a Windows service to me.
Was This Post Helpful? 0
  • +
  • -

#8 crimsonK8  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 11-January 12

Re: Windows app deployment so that executable can take parameters

Posted 13 January 2012 - 06:22 AM

Doesn't a windows service run all the time tho'??
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1